"use strict";var __read=this&&this.__read||function(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar},__spreadArray=this&&this.__spreadArray||function(to,from,pack){if(pack||2===arguments.length)for(var ar,i=0,l=from.length;i<l;i++)!ar&&i in from||((ar=ar||Array.prototype.slice.call(from,0,i))[i]=from[i]);return to.concat(ar||Array.prototype.slice.call(from))},__extends=this&&this.__extends||function(){var extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)Object.prototype.hasOwnProperty.call(b,p)&&(d[p]=b[p])})(d,b)};return function(d,b){if("function"!=typeof b&&null!==b)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}(),__decorate=this&&this.__decorate||function(decorators,target,key,desc){var d,c=arguments.length,r=c<3?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(c<3?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r},__metadata=this&&this.__metadata||function(k,v){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(k,v)},__values=this&&this.__values||function(o){var s="function"==typeof Symbol&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&"number"==typeof o.length)return{next:function(){return{value:(o=o&&i>=o.length?void 0:o)&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__rest=this&&this.__rest||function(s,e){var t={};for(p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t};Array.prototype.find||(Array.prototype.find=function(fn){for(var i=0;i<this.length;i++)if(fn(this[i]))return this[i]}),function(bnt){bnt.fnName=function(fnStr){if("function"!=typeof fnStr)throw new Error("Invalid argument!");return fnStr.name||(fnStr=fnStr.toString()).substring(9,fnStr.indexOf("(")).trim()}}(bnt=bnt||{}),function(bnt){var LameMap=function(){function LameMap(){this.index=[],this.values=[]}return LameMap.prototype.get=function(i){i=this.index.indexOf(i);if(-1!=i)return this.values[i]},LameMap.prototype.set=function(k,v){var i=this.index.indexOf(k);-1==i&&(i=this.index.length,this.index.push(k)),this.values[i]=v},LameMap}();function amap(){return new LameMap}function isDefined(thing){return void 0!==thing&&null!=thing}function isPrimitive(primitive){return-1!=[Number,Function,String,Boolean].indexOf(primitive.constructor)}function pairSet(thing,pairSetCache){var cache=pairSetCache.get(thing);return cache||(cache=(cache=Object.keys(thing)).filter(function(name){return isDefined(thing[name])&&!isTransient(thing.constructor,name,thing[name])}),pairSetCache.set(thing,cache)),cache}function ndesc(thing,themap){return themap.get(thing)}function isSerializable(thing){return isPrimitive(thing)||thing.constructor==Array||thing.constructor==Object||bnt.types[bnt.fnName(thing.constructor)]}function isTransient(typething,propertyName,theTransients){var propertyType=theTransients.constructor,theTransients=bnt.fnName(typething),typething=bnt.types[theTransients],theTransients=bnt.transients[theTransients];return typething&&typething.transientTypesMap[bnt.fnName(propertyType)]||theTransients&&theTransients[propertyName]}function nmark(thing,path,themap,pairSetCache){var desc=ndesc(thing,themap);if(isDefined(thing)&&!desc&&isSerializable(thing)){var desc_1={ctor:bnt.fnName(thing.constructor),paths:[path],props:{},seen:!1};themap.set(thing,desc_1),pairSet(thing,pairSetCache).forEach(function(name){isPrimitive(thing[name])?desc_1.props[name]=thing[name]:nmark(thing[name],path.slice().concat([name]),themap,pairSetCache)})}else if(desc)desc.paths.push(path);else if(isDefined(thing)&&!isSerializable(thing))throw new Error("Not serializable: "+bnt.fnName(thing.constructor)+" at /"+path)}function npath(path,thing,target){var first;1==path.length?target[path[0]]=thing:(first=path.shift(),npath(path,thing,target[first]))}function nmarshall(thing){var out=[],themap=amap(),pairSetCache=amap();if(isDefined(thing)&&!isPrimitive(thing))return nmark(thing,[],themap,pairSetCache),function nser(thing,path,out,themap,pairSetCache){var def,desc=ndesc(thing,themap);if(!desc)throw new Error("no desc");desc.seen||(desc.seen=!0,def=[desc.ctor,desc.paths],Object.keys(desc.props).length&&def.push(desc.props),out.push(desc),pairSet(thing,pairSetCache).forEach(function(name){var element=thing[name];!isPrimitive(element)&&isDefined(element)&&nser(element,path.slice().concat([name]),out,themap,pairSetCache)}))}(thing,[],out,themap,pairSetCache),out.forEach(function(desc){delete desc.seen}),out;throw console.error("noser",thing),new Error("not supported for serialization")}function nunmarshall(out){return function(out){var assignStages=[],ret=void 0;return out.forEach(function(config){var type,ctor=config.ctor,paths=config.paths,props=config.props,config=bnt.types[ctor];if(config)type=config.type;else if("Array"==ctor)type=Array;else{if("Object"!=ctor)throw new Error("Cannot deserialize: "+ctor);type=Object}var thing=new type;props&&Object.keys(props).filter(function(prop){return isDefined(props[prop])&&!isTransient(type,prop,props[prop])}).forEach(function(key){thing[key]=props[key]}),paths.forEach(function(path,stage){assignStages[stage]||(assignStages[stage]=[]),assignStages[stage].push([thing,path])})}),assignStages.forEach(function(assignStage){return assignStage.forEach(function(thing){var path=__read(thing,2),thing=path[0],path=path[1];0==path.length?ret=thing:npath(path,thing,ret)})}),ret}(out)}bnt.LameMap=LameMap,bnt.amap=amap,bnt.isDefined=isDefined,bnt.isPrimitive=isPrimitive,bnt.isSerializable=isSerializable,bnt.isTransient=isTransient,bnt.nmark=nmark,bnt.npath=npath,bnt.nmarshall=nmarshall,bnt.nserialize=function(thing){return JSON.stringify(nmarshall(thing))},bnt.ndeserialize=function(str){return nunmarshall(JSON.parse(str))},bnt.nunmarshall=nunmarshall}(bnt=bnt||{}),function(bnt){function refCheck(thing,reference,refCtx){reference=refCtx.getOrCreate(thing,reference);return reference.created?reference.object:{":ref":reference.index}}bnt.types={},bnt.transients={};var Reference=function(object,index,created){this.object=object,this.index=index,this.created=created};function indexof2(arr,t){return arr.indexOf(t)}bnt.Reference=Reference,bnt.indexof2=indexof2;var ReferenceContext=function(){function ReferenceContext(){this.things=[],this.store=[]}return ReferenceContext.prototype.getOrCreate=function(thing,createFn){var idx=-1,created=!1;return-1==(idx="object"==typeof thing&&null!==thing&&thing.constructor!=Number&&thing.constructor!=Boolean&&thing.constructor!=String?indexof2(this.things,thing):idx)&&(idx=this.things.length,this.things.push(thing),this.store[idx]=createFn(),created=!0),new Reference(this.store[idx],idx,created)},ReferenceContext.prototype.get=function(index){return this.things[index]},ReferenceContext.prototype.register=function(thing){var idx=this.things.length;return this.things[idx]=thing,this.store[idx]=null,idx},ReferenceContext}();function serializeAny(thing,refCtx){if(void 0===thing)return refCheck({},function(){return thing},refCtx);if(null===thing)return refCheck({},function(){return thing},refCtx);switch(thing.constructor){case Number:case Boolean:case String:return refCheck(thing,function(){return thing},refCtx);case Array:return refCheck(thing,function(){return function(array,refCtx){return array.map(function(element){return serializeAny(element,refCtx)})}(thing,refCtx)},refCtx);default:return refCheck(thing,function(){return function(object,refCtx){var result={},constructorName=object.constructor&&bnt.fnName(object.constructor)?bnt.fnName(object.constructor):"Object",config=bnt.types[constructorName],content={},transientTypes={};return config&&config.transientTypes&&config.transientTypes.forEach(function(type){return transientTypes[bnt.fnName(type)]=!0}),Object.keys(object).filter(function(key){return!(bnt.transients[constructorName]&&bnt.transients[constructorName][key])}).filter(function(key){return!(object[key]&&object[key].constructor&&transientTypes[bnt.fnName(object[key].constructor)])}).forEach(function(key){return content[key]=serializeAny(object[key],refCtx)}),result[constructorName]=content,result}(thing,refCtx)},refCtx)}}function deserializeObject(object,refCtx){var type=Object.keys(object)[0];return function(name,object,refCtx){var config=null;if(config="Object"==name?{type:Object}:bnt.types[name]){var o_1=new config.type,ret_1=new PartialObject(o_1,refCtx.register(o_1));return Object.keys(object).forEach(function(name){var field=deserializeAny(object[name],refCtx);ret_1.mutateAll(field.mutators),ret_1.mutate(field.index,function(value){o_1[name]=value}),ret_1.registerKey(name,field.index)}),ret_1}throw new Error("Non Serializable: "+name)}(type,object[type],refCtx)}bnt.ReferenceContext=ReferenceContext,bnt.serializeAny=serializeAny,bnt.omarshall=function(thing){return serializeAny(thing,new ReferenceContext)},bnt.marshall=function(thing){return bnt.nmarshall(thing)},bnt.serialize=function(thing){return JSON.stringify(bnt.nmarshall(thing))};var PartialObject=function(){function PartialObject(instance,index){this.instance=instance,this.index=index,this.mutators=[],this.keys=[]}return PartialObject.prototype.withKey=function(key,fn){var _a=this.keys.filter(function(name){var _b=__read(name,2),name=_b[0];_b[1];return name==key});if(_a.length){_a=__read(_a[0],2),_a[0];return[_a[1],fn]}throw new Error("Key missing: "+key)},PartialObject.prototype.registerKey=function(key,refIndex){this.keys.push([key,refIndex])},PartialObject.prototype.mutate=function(refIndex,fn){this.mutators.push([refIndex,fn])},PartialObject.prototype.mutateIn=function(mutator){this.mutators.push(mutator)},PartialObject.prototype.mutateAll=function(mutators){this.mutators.push.apply(this.mutators,mutators)},PartialObject.prototype.executeMutations=function(refCtx){this.mutators.forEach(function(index){var _b=__read(index,2),index=_b[0];(0,_b[1])(refCtx.get(index))})},PartialObject}();function deserializeAny(thing,refCtx){if(void 0===thing)return new PartialObject(void 0,refCtx.register(void 0));if(null===thing)return new PartialObject(null,refCtx.register(null));switch(thing.constructor){case Number:case String:case Boolean:return new PartialObject(thing,refCtx.register(thing));case Array:return function(array,refCtx){var arr=[],ret=new PartialObject(arr,refCtx.register(arr));return array.forEach(function(obj,index){obj=deserializeAny(obj,refCtx);ret.mutateAll(obj.mutators),ret.mutate(obj.index,function(value){arr[index]=value}),ret.registerKey(index.toString(),obj.index)}),ret}(thing,refCtx);default:return void 0!==thing[":ref"]?new PartialObject(void 0,thing[":ref"]):deserializeObject(thing,refCtx)}}function ounmarshall(ret){var refCtx=new ReferenceContext,ret=deserializeAny(ret,refCtx);return ret.executeMutations(refCtx),ret.instance}function zunmarshall(obj){return obj.constructor==Object?ounmarshall(obj):bnt.nunmarshall(obj)}function getOldCanvasHash(canvas){return(canvas.config.width<<16)+canvas.config.height+""}function unmarshall(creative){var idToUUID,migrateCanvas,migrateEos,thing=zunmarshall(creative);return null!=thing&&thing instanceof bnt.Creative&&function(state){var elementStore=state.elements.store,state_hash=Object.keys(elementStore).find(function(configStore){configStore=elementStore[configStore].v.configs.store;return Object.keys(configStore).find(function(state_hash){return 0<state_hash.length})});if(state_hash){state=elementStore[state_hash].v.configs.store,state_hash=Object.keys(state).find(function(state_hash){return 0<state_hash.length}),state=state[state_hash].k;return getOldCanvasHash(state.canvas)+"_"+state.segment.hash()==state_hash}}(thing)&&(console.warn("migrating"),creative=thing,idToUUID=new bnt.Map(new bnt.StringHash),migrateEos=function(eos){var eosStore=eos.configs.store;Object.keys(eosStore).forEach(function(key){migrateCanvas(eosStore[key].k.canvas),eos.setConfig(eosStore[key].k,eosStore[key].v),delete eosStore[key]});var elementStore=eos.element.configs.store;Object.keys(elementStore).forEach(function(key){migrateCanvas(elementStore[key].k.canvas),eos.element.setConfig(elementStore[key].k,elementStore[key].v),delete elementStore[key]})},creative.canvases.forEach(migrateCanvas=function(canvas){var uuid;idToUUID.contains(getOldCanvasHash(canvas))?uuid=idToUUID.get(getOldCanvasHash(canvas)):(uuid=bnt.UUID.get(),idToUUID.put(getOldCanvasHash(canvas),uuid)),canvas.uuid=uuid}),creative.bannerCanvases&&creative.bannerCanvases.forEach(migrateCanvas),creative.forEachScreen(function(screen){screen.forEachEos(function(eos){migrateEos(eos)})}),creative.bannerScreen&&creative.bannerScreen.forEachEos(function(eos){migrateEos(eos)})),thing}function register(type,config){config.type||(config.type=type),config.transientTypes||(config.transientTypes=[]),config.transientTypes=__spreadArray(__spreadArray([],__read(config.transientTypes),!1),[Function],!1);var transientTypesMap={};config.transientTypes.forEach(function(type){return transientTypesMap[bnt.fnName(type)]=!0}),bnt.types[bnt.fnName(type)]={namespace:config.namespace,transientTypes:config.transientTypes,transientTypesMap:transientTypesMap,type:config.type}}function registerTransient(type,property){bnt.transients[bnt.fnName(type)]||(bnt.transients[bnt.fnName(type)]={}),bnt.transients[bnt.fnName(type)][property.toString()]=!0}bnt.PartialObject=PartialObject,bnt.deserializeAny=deserializeAny,bnt.ounmarshall=ounmarshall,bnt.zunmarshall=zunmarshall,bnt.unmarshall=unmarshall,bnt.deserialize=function(serialized_obj){return unmarshall(JSON.parse(serialized_obj))},bnt.register=register,bnt.Serializable=function(config){return function(type){register(type,config)}},bnt.registerTransient=registerTransient,bnt.Transient=function(object,property){registerTransient(object.constructor,property)}}(bnt=bnt||{}),function(bnt){var HashFn=function(){function HashFn(){}return __decorate([bnt.Serializable({})],HashFn)}(),Map=function(_super){function FunctionHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(FunctionHash,_super),FunctionHash.prototype.hash=function(fn){var name=bnt.fnName(fn);if(!name)throw new Error("function without a name cannot server as map keys\n        param was: ".concat(JSON.stringify(fn),"\n        "));return name},__decorate([bnt.Serializable({})],FunctionHash)}(bnt.HashFn=HashFn);bnt.FunctionHash=Map;Map=function(_super){function NumberHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(NumberHash,_super),NumberHash.prototype.hash=function(n){return n.toString()},__decorate([bnt.Serializable({})],NumberHash)}(HashFn);bnt.NumberHash=Map;Map=function(_super){function StringHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(StringHash,_super),StringHash.prototype.hash=function(s){return s},__decorate([bnt.Serializable({})],StringHash)}(HashFn);bnt.StringHash=Map;Map=function(_super){function StringArrayHash(){return null!==_super&&_super.apply(this,arguments)||this}var StringArrayHash_1;return __extends(StringArrayHash,_super),(StringArrayHash_1=StringArrayHash).hash=function(a){for(var hash=0,i=0;i<a.length;i++)for(var j=0;j<a[i].length;j++)hash=31*hash+a[i].charCodeAt(j);return hash+""},StringArrayHash.prototype.hash=function(a){return StringArrayHash_1.hash(a)},StringArrayHash_1=__decorate([bnt.Serializable({})],StringArrayHash)}(HashFn);bnt.StringArrayHash=Map;var Entry=function(){function Entry(k,v){this.k=k,this.v=v}return __decorate([bnt.Serializable({}),__metadata("design:paramtypes",[Object,Object])],Entry)}(),Map=function(){function Map(hashFn){this.hashFn=hashFn,this.store={}}var Map_1=Map;return Map.prototype.getEntry=function(k){if(void 0!==k)return this.store[this.hashFn.hash(k)]},Map.prototype.get=function(entry){entry=this.getEntry(entry);if(entry)return entry.v},Map.prototype.getDefault=function(k,defaultValue){return this.get(k)||defaultValue},Map.prototype.first=function(){var keys=Object.keys(this.store);if(keys.length)return this.store[keys[0]].v},Map.prototype.size=function(){return Object.keys(this.store).length},Map.prototype.put=function(k,v){var entry=this.getEntry(k);entry?entry.v=v:this.store[this.hashFn.hash(k)]=new Entry(k,v)},Map.prototype.update=function(k,defaultValue,mutator){var value=this.get(k);void 0!==value&&!isNaN(value)||(value=defaultValue),this.put(k,mutator(value))},Map.prototype.remove=function(k){delete this.store[this.hashFn.hash(k)]},Map.prototype.filter=function(fn){var map=new Map_1(this.hashFn);return this.forEach(function(k,v){fn(k,v)&&map.put(k,v)}),map},Map.prototype.contains=function(k){return void 0!==this.get(k)},Map.prototype.mapKeys=function(fn){var ret=new Map_1(this.hashFn);return this.forEach(function(k,v){return ret.put(k,fn(k,v))}),ret},Map.prototype.mapToArray=function(fn){var ret=new Array;return this.forEach(function(k,v){return ret.push(fn(k,v))}),ret},Map.prototype.forEach=function(fn){for(var entry in this.store){entry=this.store[entry];fn(entry.k,entry.v)}},Map.prototype.one=function(){return this.first()},Map.prototype.clear=function(){this.store={}},Map_1=__decorate([bnt.Serializable({}),__metadata("design:paramtypes",[HashFn])],Map)}();bnt.Map=Map}(bnt=bnt||{}),function(bnt){function applyMixins(derivedCtor,baseCtors){baseCtors.forEach(function(baseCtor){Object.getOwnPropertyNames(baseCtor.prototype).filter(function(name){return"constructor"!=name}).forEach(function(name){derivedCtor.prototype[name]=baseCtor.prototype[name]})})}bnt.applyMixins=applyMixins,bnt.extendInstance=function(instance,baseCtors){baseCtors.forEach(function(baseCtor){Object.getOwnPropertyNames(baseCtor.prototype).filter(function(name){return"constructor"!=name}).forEach(function(name){instance[name]=baseCtor.prototype[name]})})},bnt.Mixin=function(){for(var mixedTypes=[],_i=0;_i<arguments.length;_i++)mixedTypes[_i]=arguments[_i];return function(baseType){bnt.MixinRegistry.put(baseType,mixedTypes),applyMixins(baseType,mixedTypes)}},bnt.MixinRegistry=new bnt.Map(new bnt.FunctionHash)}(bnt=bnt||{}),function(bnt){function set2(map,name,data){var entry=map[name];entry||(map[name]=entry=[]),entry.push(data)}bnt.EVENTS={},bnt.ACTIONS={},bnt.Event=function(filter){return function(element,eventName){set2(bnt.EVENTS,bnt.fnName(element.constructor),{event:eventName,filter:filter})}},bnt.Action=function(options){for(var actionParameters=[],_i=1;_i<arguments.length;_i++)actionParameters[_i-1]=arguments[_i];return function(implementedIn,actionName,descriptor){var implPlace="element";switch(bnt.fnName(implementedIn.constructor)){case"Renderer":implPlace="renderer";break;case"VideoTimeline":implPlace="element";break;case"CreativeRenderer":implPlace="creativeRenderer";break;case"AdController":implPlace="controller";break;case"TrackingUnit":implPlace="tracking"}set2(bnt.ACTIONS,bnt.fnName(options&&options.actionOf||implementedIn.constructor),{name:actionName,actionOf:options&&options.actionOf,implementedIn:implPlace,config:actionParameters,allowed:options&&options.allowed||function(){return!0}})}}}(bnt=bnt||{});var jsSet=Set;!function(bnt){var Set=function(){function Set(hashFn){this.hashFn=hashFn,this.store={},this._length=0}var Set_1=Set;return Set.prototype.contains=function(t){return null!=this.store[this.hashFn.hash(t)]},Object.defineProperty(Set.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),Set.prototype.add=function(t){return this.contains(t)||(this._length=this._length+1),this.store[this.hashFn.hash(t)]=t},Set.prototype.remove=function(t){var hash=this.hashFn.hash(t);return null!=typeof this.store[hash]&&(delete this.store[hash],this._length=this._length-1),t},Set.prototype.toArray=function(){var _this=this;return Object.keys(this.store).map(function(key){return _this.store[key]})},Set.prototype.forEach=function(walker){for(var name_1 in this.store)walker(this.store[name_1])},Set.prototype.mapToArray=function(fn){var _this=this;return Object.keys(this.store).map(function(key){return fn(_this.store[key])})},Set.prototype.missingFrom=function(set){var ret=new Set_1(this.hashFn);return this.forEach(function(e){set.contains(e)||ret.add(e)}),ret},Set.prototype.commonWith=function(set){var ret=new Set_1(this.hashFn);return this.forEach(function(e){set.contains(e)&&ret.add(e)}),ret},Set.prototype.one=function(){return this.store[Object.keys(this.store)[0]]},Set.prototype.clear=function(){this.store={},this._length=0},Set_1=__decorate([bnt.Serializable({}),__metadata("design:paramtypes",[bnt.HashFn])],Set)}();bnt.Set=Set}(bnt=bnt||{}),function(bnt){var SortedEntry=function(order,t){this.order=order,this.t=t},SortedSet=function(){function SortedSet(order){this.order=order,this.store=new Array}return SortedSet.prototype.add=function(t){return this.insertSort(new SortedEntry(this.order(t),t),0,this.store.length)},SortedSet.prototype.with=function(ts){var _this=this;return ts.forEach(function(t){return _this.add(t)}),this},SortedSet.prototype.first=function(){if(this.store.length)return this.store[0].t},SortedSet.prototype.remove=function(t){this.removeSort(this.order(t),0,this.store.length)},SortedSet.prototype.contains=function(t){return this.seek(new SortedEntry(this.order(t),t),0,this.store.length)},SortedSet.prototype.seek=function(entry,startIndex,endIndex){if(endIndex-startIndex<1)return!1;var midIndex=Math.floor((endIndex+startIndex)/2),midEntry=this.store[midIndex];return entry.order<midEntry.order?this.seek(entry,startIndex,midIndex):!(entry.order>midEntry.order)||this.seek(entry,midIndex+1,endIndex)},SortedSet.prototype.removeSort=function(order,startIndex,endIndex){if(endIndex-startIndex<1)return!1;var midIndex=Math.floor((endIndex+startIndex)/2),midEntry=this.store[midIndex];return order<midEntry.order?this.removeSort(order,startIndex,midIndex):order>midEntry.order?this.removeSort(order,midIndex+1,endIndex):(this.store.splice(midIndex,1),!0)},SortedSet.prototype.insertSort=function(entry,startIndex,endIndex){if(endIndex-startIndex<1)return this.store.splice(startIndex,0,entry),!0;var midIndex=Math.floor((endIndex+startIndex)/2),midEntry=this.store[midIndex];return entry.order<midEntry.order?this.insertSort(entry,startIndex,midIndex):entry.order>midEntry.order&&this.insertSort(entry,midIndex+1,endIndex)},SortedSet}();bnt.SortedSet=SortedSet}(bnt=bnt||{}),function(bnt){bnt.Success=function(value){this.value=value},bnt.Failure=function(failure){this.failure=failure}}(bnt=bnt||{}),function(bnt){var SimpleFuture=function(){function SimpleFuture(listenerSink){this.listenerSink=listenerSink,this.completed=!1}return SimpleFuture.prototype.map=function(func){var promise=new Promise;return this.onComplete(function(t){t instanceof bnt.Success?promise.fulfill(new bnt.Success(func(t.value))):t instanceof bnt.Failure&&promise.fulfill(t)}),promise.future},SimpleFuture.prototype.filter=function(func){var promise=new Promise;return this.onComplete(function(t){t instanceof bnt.Success?func(t.value)&&promise.fulfill(t):t instanceof bnt.Failure&&promise.fulfill(t)}),promise.future},SimpleFuture.prototype.flatMap=function(func){var promise=new Promise;return this.onComplete(function(t){t instanceof bnt.Success?func(t.value).onComplete(function(theTry){promise.fulfill(theTry)}):t instanceof bnt.Failure&&promise.fulfill(t)}),promise.future},SimpleFuture.prototype.onComplete=function(func){this.listenerSink(func)},SimpleFuture.prototype.onSuccess=function(func){this.listenerSink(function(t){t instanceof bnt.Success&&func(t.value)})},SimpleFuture.prototype.onFailure=function(func){this.listenerSink(function(t){t instanceof bnt.Failure&&func(t.failure)})},SimpleFuture}(),Promise=function(){function Promise(){var _this=this;this.createStack=(new Error).stack,this.fulfillStack=null,this.listenerSink=new Array,this.theFuture=new SimpleFuture(function(l){if(_this.fulfilled)try{l(_this.fulfilledWith)}catch(e){e instanceof Error&&console.error(e.stack),bnt.logger.error(e)}else _this.listenerSink.push(l)}),this.future=this.theFuture,this.fulfilled=!1,this.fulfilledWith=void 0}return Promise.forAll=function(futures){var results=new Array,remaining=futures.length,promise=new Promise;return remaining<=0?promise.fulfill(new bnt.Success(results)):futures.map(function(f,index){return f.onComplete(function(t){results[index]=t,--remaining<=0&&promise.fulfill(new bnt.Success(results))})}),promise.future},Promise.fulfilledWith=function(t){return(new Promise).fulfill(new bnt.Success(t))},Promise.failedWith=function(failure){return(new Promise).fulfill(new bnt.Failure(failure))},Promise.asyncFulfilledWith=function(t){var promise=new Promise;return setTimeout(function(){return promise.fulfill(new bnt.Success(t))},0),promise},Promise.tryFulfill=function(fn){var p=new Promise;try{var ret=fn();if("object"==typeof ret&&null!=ret&&"function"==typeof ret.then)ret.then(function(t){p.succeed(t)},function(e){return p.fail(e)});else{if(ret instanceof Promise)return ret.future;if(ret instanceof SimpleFuture)return ret;p.succeed(ret)}}catch(e){e instanceof Error?p.fail(e):p.fail(new Error(String(e)))}return p.future},Promise.prototype.succeed=function(t){this.fulfill(new bnt.Success(t))},Promise.prototype.fail=function(e){this.fulfill(new bnt.Failure(e))},Promise.prototype.fulfill=function(t){var _this=this;if(this.fulfilled)throw new Error("Promise already fulfilled");return this.fulfilled=!0,this.theFuture.completed=!0,this.fulfilledWith=t,this.listenerSink.map(function(listener){try{listener(t)}catch(e){console.warn("Promise listener failed. Promise created at",_this.createStack),console.error("Listener failed at",e),bnt.logger.error("Listener failed at",e)}}),t instanceof bnt.Failure&&0==this.listenerSink.length&&(console.warn("Promise failed. Promise created at",this.createStack),console.error("Promise failed at",t.failure),bnt.logger.error("Promise failed at",t.failure)),this},Promise}();bnt.Promise=Promise}(bnt=bnt||{}),function(bnt){var IdHash=function(){function IdClass(){}return IdClass.getNext=function(){return IdClass.instance+++""},IdClass.instance=0,IdClass}();bnt.IdClass=IdHash;IdHash=function(_super){function IdHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(IdHash,_super),IdHash.prototype.hash=function(idk){return idk.id},__decorate([bnt.Serializable({})],IdHash)}(bnt.HashFn);bnt.IdHash=IdHash}(bnt=bnt||{}),function(bnt){var Observable=function(){function Observable(handleVoidUpdate){this.handleVoidUpdate=handleVoidUpdate=void 0===handleVoidUpdate?!0:handleVoidUpdate,this.observers=new Array,this.onVoidUpdate=void 0,handleVoidUpdate&&(this.onVoidUpdate=new Observable(!1))}return Observable.prototype.buildSelf=function(){return new Observable},Observable.prototype.addObserver=function(o){this.observers.push(o)},Observable.prototype.removeObserver=function(pos){pos=this.observers.indexOf(pos);-1!=pos&&delete this.observers[pos]},Observable.prototype.addEventListener=function(o){this.addObserver(o)},Observable.prototype.hasObserver=function(o){return-1!=this.observers.indexOf(o)},Observable.prototype.hasObservers=function(ignoreUndefined){return(ignoreUndefined=void 0!==ignoreUndefined&&ignoreUndefined)?this.observers.some(function(observer){return void 0!==observer}):0<this.observers.length},Observable.prototype.update=function(t){var _this=this;this.hasObservers()?this.observers.forEach(function(observer){return observer(t,_this)}):this.handleVoidUpdate&&this.onVoidUpdate.update(void 0)},Observable.prototype.map=function(mapper){var observable=this.buildSelf();return this.addObserver(function(t,o){return observable.update(mapper(t))}),observable},Observable.prototype.futureMap=function(mapper){var observable=this.buildSelf();return this.addObserver(function(t){return mapper(t).onSuccess(function(v){return observable.update(v)})}),observable},Observable.prototype.filter=function(filter){var observable=this.buildSelf();return this.addObserver(function(t,o){filter(t)&&observable.update(t)}),observable},Observable}();bnt.Observable=Observable}(bnt=bnt||{}),function(bnt){var ObservableValue=function(_super){function ObservableValue(t){var _this=_super.call(this)||this;return(_this.value=void 0)!==t&&_this.update(t),_this}return __extends(ObservableValue,_super),ObservableValue.prototype.buildSelf=function(){return new ObservableValue},ObservableValue.prototype.addObserver=function(l){_super.prototype.addObserver.call(this,l),void 0!==this.value&&l(this.value,this)},ObservableValue.prototype.update=function(t){this.value=t,_super.prototype.update.call(this,t)},ObservableValue}(bnt.Observable);bnt.ObservableValue=ObservableValue}(bnt=bnt||{}),function(bnt){function log_via_request(msg){try{var url="http://bnt.log/?".concat(JSON.stringify(msg));(new Image).src=url}catch(er){}}function generateConsole(level,args){var logLevelAsString=LogLevel[level];args[0]="bnt."+logLevelAsString.toLowerCase()+": "+args[0]+" ",logLevelAsString&&level<=bnt.logger.LOG_LEVEL&&("undefined"!=typeof console&&void 0!==console[logLevelAsString]&&console[logLevelAsString].apply(console,args),(bnt.QueryParams.get("useLogRequest")||bnt.logger.useRequest)&&log_via_request(args.join("_").replace(/\s/gi,"_")))}var LogLevel;!function(LogLevel){LogLevel[LogLevel.error=0]="error",LogLevel[LogLevel.warn=1]="warn",LogLevel[LogLevel.info=2]="info",LogLevel[LogLevel.debug=3]="debug"}(LogLevel=bnt.LogLevel||(bnt.LogLevel={})),bnt.logger={LOG_LEVEL:LogLevel.error,useRequest:!1,log:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];generateConsole(LogLevel.debug,args)},info:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];generateConsole(LogLevel.info,args)},warn:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];generateConsole(LogLevel.warn,args)},debug:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];generateConsole(LogLevel.debug,args)},error:function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];generateConsole(LogLevel.error,args)},log_via_request:log_via_request}}(bnt=bnt||{}),function(bnt){var AssetNature=function(){function AssetNature(){}return AssetNature.TYPE_IMAGE="image",AssetNature.TYPE_VIDEO="video",AssetNature.TYPE_VAST="vast",AssetNature}();bnt.AssetNature=AssetNature,bnt.LIBRARY={},bnt.ASSET_VERSIONS={};var ASSET_VERSIONS_LABELS={videoMobile:"mp4_768k",videoDesktop:"mp4_1536k",thumb:"thumb",imageFallback:"fallback"};function extractAssetId(urlOrAsset){return urlOrAsset.slice("asset://".length)}function getSrc(assetVersions){if(0!=(assetVersions="string"!=typeof assetVersions?"":assetVersions).indexOf("asset://"))return assetVersions;var assetId=extractAssetId(assetVersions),asset=bnt.LIBRARY[assetId];if(null!==(assetVersions=null==asset?void 0:asset.crop)&&void 0!==assetVersions&&assetVersions.link)return asset.crop.link;assetVersions=bnt.ASSET_VERSIONS[assetId];if(assetVersions){if(bnt.isMobile()&&assetVersions[ASSET_VERSIONS_LABELS.videoMobile])return assetVersions[ASSET_VERSIONS_LABELS.videoMobile];if(assetVersions[ASSET_VERSIONS_LABELS.videoDesktop])return assetVersions[ASSET_VERSIONS_LABELS.videoDesktop];if(assetVersions[ASSET_VERSIONS_LABELS.imageFallback])return assetVersions[ASSET_VERSIONS_LABELS.imageFallback]}if(!asset)throw new Error("asset not defined: "+assetId);return asset.link}function isWebpSupported(){var osName=DeviceContext.getBrowser(),isMacOS=osName.name.toLowerCase(),osVersionMajor="string"==typeof osName.version?osName.version:"",unsupportedIOSVersion=__read(osVersionMajor.split(".").map(function(v){return parseInt(v,10)}),2),browserVersionMajor=unsupportedIOSVersion[0],unsupportedMacOSVersion=unsupportedIOSVersion[1],isSafari=DeviceContext.getOS(),osName=isSafari.name.toLowerCase(),osVersionMajor=parseInt(isSafari.vmajor,10),unsupportedIOSVersion=parseInt(isSafari.vminor,10),isSafari=isMacOS.includes("safari"),isMacOS=osName.includes("mac"),unsupportedIOSVersion=osName.includes("ios")&&(isNaN(osVersionMajor)||isNaN(unsupportedIOSVersion)||osVersionMajor<14||14===osVersionMajor&&unsupportedIOSVersion<5),unsupportedMacOSVersion=isMacOS&&isSafari&&(isNaN(browserVersionMajor)||isNaN(unsupportedMacOSVersion)||browserVersionMajor<14||14===browserVersionMajor&&unsupportedMacOSVersion<1);return!unsupportedIOSVersion&&!unsupportedMacOSVersion}function getRawSrcSet(_a){if((_a="string"!=typeof _a?"":_a).startsWith("asset://")){var sizes=extractAssetId(_a),_a=bnt.LIBRARY[sizes];if((null===(_a=null==_a?void 0:_a.crop)||void 0===_a||!_a.link)&&isWebpSupported()){var assetVersions=bnt.ASSET_VERSIONS[sizes];if(assetVersions){sizes=Object.keys(assetVersions).map(function(v){return parseInt(v,10)}).filter(function(s){return!isNaN(s)}).sort(function(a,b){return a-b});if(0!==sizes.length)return sizes.map(function(size){return[size,assetVersions[size]]})}}}}function getSrcSetInfo(rawSrcset,width){rawSrcset=getRawSrcSet(rawSrcset);if(rawSrcset)return{rawSrcset:rawSrcset,srcset:rawSrcset.map(function(size){var link=__read(size,2),size=link[0],link=link[1];return"".concat(link," ").concat(size,"w")}).join(", "),sizes:getSizes(width)}}function getSizes(width){return"".concat(100*width/bnt.get(bnt.State).canvas.config.width,"vw")}function setSizes(img,sizes){img.sizes!==sizes&&(img.sizes=sizes)}function getCurrentSrc(img){if(img)return"currentSrc"in img?img.currentSrc:img.src}function formatProtocol(url){return url}bnt.isVast=function(assetId){return assetId=assetId.slice("asset://".length),bnt.LIBRARY[assetId]&&bnt.LIBRARY[assetId].nature===AssetNature.TYPE_VAST},bnt.getVast=function(assetId){return assetId=assetId.slice("asset://".length),bnt.LIBRARY[assetId].link},bnt.extractAssetId=extractAssetId,bnt.getAssetLink=function(asset){var _a;return(null===(_a=asset.crop)||void 0===_a?void 0:_a.link)||asset.link},bnt.getSrc=getSrc,bnt.isWebpSupported=isWebpSupported,bnt.getRawSrcSet=getRawSrcSet,bnt.getSrcSetInfo=getSrcSetInfo,bnt.getSizes=getSizes,bnt.setSrc=function(img,urlOrAsset,srcSetInfo){if(img){var src=getSrc(urlOrAsset);if(img.src!==src){if(!src)return img.removeAttribute("src"),void img.removeAttribute("srcset");srcSetInfo=getSrcSetInfo(urlOrAsset,srcSetInfo);srcSetInfo&&(setSizes(img,srcSetInfo.sizes),img.srcset=srcSetInfo.srcset),img.src=src}}},bnt.setSizes=setSizes,bnt.getCurrentSrc=getCurrentSrc,bnt.getCurrentSrcAsync=function(img,cb){var listener_1;img||cb(void 0),img.complete?cb(getCurrentSrc(img)):(listener_1=function(){img.removeEventListener("load",listener_1),cb(getCurrentSrc(img))},img.addEventListener("load",listener_1))},bnt.formatProtocol=formatProtocol,bnt.setupWebkitResponsiveImageFix=function(image){var isIOS,isMacOS,isSafari,isWebview,debounceIds,fn;image&&image.srcset&&(isIOS=DeviceContext.getBrowser().name.toLowerCase(),isMacOS=DeviceContext.getOS().name.toLowerCase(),isSafari=isIOS.includes("safari"),isWebview=isIOS.includes("webkit"),isIOS=isMacOS.includes("ios"),isMacOS=isMacOS.includes("mac"),(isSafari||isIOS||isMacOS&&isWebview)&&(debounceIds=[],fn=function(){return image.src+=""},bnt.get(bnt.ResizeController).resize.addObserver(function(_){debounceIds.forEach(function(id){return clearTimeout(id)}),debounceIds=[0,10,20,40,80,160,320,640,1280].map(function(time){return setTimeout(fn,time)})})))}}(bnt=bnt||{}),function(bnt){var Brain=function(){function Brain(){}return Brain.hexToRgb=function(triplets){var check=new RegExp("^(#)?([0-9a-fA-F]{3})([0-9a-fA-F]{3})?$");if(3!=(tempHex="#"==(tempHex=triplets)[0]?tempHex.substr(1):tempHex).length&&6!=tempHex.length||!check.test(tempHex))return bnt.logger.warn("Invalid hex!",triplets),[0,0,0];if(3==tempHex.length)for(var temp=tempHex,tempHex="",i=0;i<3;i++)tempHex+=temp[i]+temp[i];triplets=/^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.exec(tempHex).slice(1);return[parseInt(triplets[0],16),parseInt(triplets[1],16),parseInt(triplets[2],16)]},Brain.findInContainer=function(container,theEos){var e_1,_a,parent=null;try{for(var _b=__values(container.eos),_c=_b.next();!_c.done;_c=_b.next()){var eos=_c.value;if(eos==theEos){parent=container;break}if(eos.element instanceof bnt.Group){var p=Brain.findInContainer(eos.element,theEos);if(p){parent=p;break}}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_1)throw e_1.error}}return parent},Brain.getParentForEos=function(creative,theEos){var e_2,_a;try{for(var _b=__values(creative.screens),_c=_b.next();!_c.done;_c=_b.next()){var screen_1=_c.value,p=Brain.findInContainer(screen_1,theEos);if(p)return p}}catch(e_2_1){e_2={error:e_2_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_2)throw e_2.error}}return null},Brain.getParentScreenForEos=function(creative,theEos){var e_3,_a;try{for(var _b=__values(creative.screens),_c=_b.next();!_c.done;_c=_b.next()){var screen_2=_c.value;if(Brain.findInContainer(screen_2,theEos))return screen_2}}catch(e_3_1){e_3={error:e_3_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_3)throw e_3.error}}return null},Brain.isFunction=function(value){return!!value&&"function"==typeof value&&"[object Function]"===Object.prototype.toString.call(value)},Brain.areMethodsOn=function(methodsArray,checkObject){return methodsArray.every(function(neededFn){return"function"==typeof checkObject[neededFn]})},Brain}();bnt.Brain=Brain}(bnt=bnt||{}),function(bnt){var Timer=function(){function Stopwatch(){var _this=this;this.elapsedBeforeLastStop=0,this.lastStartTime=NaN,this.sinceLastStart=function(){return isNaN(_this.lastStartTime)?0:Date.now()-_this.lastStartTime}}return Stopwatch.prototype.play=function(){isNaN(this.lastStartTime)&&(this.lastStartTime=Date.now())},Stopwatch.prototype.pause=function(){this.elapsedBeforeLastStop+=this.sinceLastStart(),this.lastStartTime=NaN},Stopwatch.prototype.stop=function(){this.elapsedBeforeLastStop=0,this.lastStartTime=NaN},Stopwatch.prototype.getTime=function(){return this.elapsedBeforeLastStop+this.sinceLastStart()},Stopwatch}(),Timer=function(_super){function Timer(duration){var _this=_super.call(this)||this;return _this.duration=duration,_this}return __extends(Timer,_super),Timer.prototype.play=function(){0===this.getTimeRemaining()&&this.stop(),_super.prototype.play.call(this)},Timer.prototype.getTimeRemaining=function(){return Math.max(this.duration-this.getTime(),0)},Timer}(bnt.Stopwatch=Timer);bnt.Timer=Timer}(bnt=bnt||{}),function(bnt){var UUID=function(){function UUID(){}return UUID.get=function(){function s4(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return s4()+s4()+"-"+s4()+"-"+s4()+"-"+s4()+"-"+s4()+s4()+s4()},UUID}();bnt.UUID=UUID}(bnt=bnt||{}),function(bnt){var QueryParams=function(){function QueryParams(){}return QueryParams.get=function(name){return QueryParams.params[name]},QueryParams.set=function(name,value){QueryParams.params[name]=value},QueryParams.has=function(name){return QueryParams.params.hasOwnProperty(name)},QueryParams.init=function(){var signals_2;QueryParams.inited||(QueryParams.inited=!0,window.addEventListener("message",function(e){var shouldUpdate_1,signals_1;e.data&&e.data.type&&"queryParams"==e.data.type&&(shouldUpdate_1=!1,signals_1=QueryParams.get(bnt.Signal.queryParamsKey),QueryParams.has(bnt.Signal.queryParamsKey)?Object.keys(e.data.data).forEach(function(k){signals_1[k]!=e.data.data[k]&&(signals_1[k]=e.data.data[k],shouldUpdate_1=!0)}):(signals_1=e.data.data,shouldUpdate_1=!0),shouldUpdate_1&&(QueryParams.set(bnt.Signal.queryParamsKey,signals_1),QueryParams.onChange.update(void 0)))}),QueryParams.has(bnt.Signal.queryParamsKey)&&(signals_2=QueryParams.get(bnt.Signal.queryParamsKey).split("|").map(function(pair){return pair.split(":")}).reduce(function(o,a){return o[a[0].replace(/_/g," ")]=a.slice(1).join(":"),o},{}),QueryParams.set(bnt.Signal.queryParamsKey,signals_2)),QueryParams.onChange.update(void 0))},QueryParams.onChange=new bnt.Observable,QueryParams.params={},QueryParams.inited=!1,QueryParams}();bnt.QueryParams=QueryParams}(bnt=bnt||{}),function(bnt){var RootContext=function(){function RootContext(){this.instances=new bnt.Map(new bnt.FunctionHash)}return RootContext.prototype.resolve=function(ctor){return this.instances.get(ctor)},RootContext.prototype.register=function(ctor,ins){this.instances.put(ctor,ins)},RootContext}(),DerivedResolveContext=function(_super){function DerivedResolveContext(){var _this=_super.call(this)||this;return _this.parent=null,_this}return __extends(DerivedResolveContext,_super),DerivedResolveContext.prototype.resolve=function(ctor){var local=_super.prototype.resolve.call(this,ctor);return void 0===local&&this.parent?this.parent.resolve(ctor):local},DerivedResolveContext}(RootContext),resolveContext=new RootContext;bnt.get=function(ctor){return resolveContext.resolve(ctor)},bnt.lazyGet=function(ctor){var boundContext=resolveContext;return function(){return boundContext.resolve(ctor)}},bnt.set=function(ctor,val){return resolveContext.register(ctor,val),val},bnt.withVals=function(vals,fn){var ctx=new DerivedResolveContext;return vals.forEach(function(ctor){var val=__read(ctor,2),ctor=val[0],val=val[1];return ctx.register(ctor,val)}),function(context,fn){var oldContext=resolveContext;context.parent=resolveContext,resolveContext=context;try{return fn.apply(this)}finally{resolveContext=oldContext}}(ctx,fn)},bnt.Singleton=function(ctor){var ins=new ctor;resolveContext.register(ctor,ins)}}(bnt=bnt||{}),function(bnt){bnt.etc=function(){return bnt.logger.log(new Error("Not implemented").stack),null},bnt.ifNotFalsy=function(value,defaultValue){return value||defaultValue},bnt.withDefault=function(value,defaultValue){return void 0!==value?value:defaultValue},bnt.addAbortableListener=function(element,eventName,handler,options){return element.addEventListener(eventName,handler,options),function(){return element.removeEventListener(eventName,handler)}}}(bnt=bnt||{}),"function"!=typeof Object.assign&&(Object.assign=function(target){if(null==target)throw new TypeError("Cannot convert undefined or null to object");for(var output=Object(target),index=1;index<arguments.length;index++){var source=arguments[index];if(null!=source)for(var nextKey in source)source.hasOwnProperty(nextKey)&&(output[nextKey]=source[nextKey])}return output}),function(bnt){bnt.style=function(element,styleOptions){for(var name in styleOptions)element.style[name]=styleOptions[name]},bnt.px=function(value){return value+"px"},bnt.percent=function(value){return value+"%"}}(bnt=bnt||{}),function(bnt){bnt.createElement=function(element,parent){return element=document.createElement(element),parent.appendChild(element),element}}(bnt=bnt||{}),function(bnt){var TextConfig=function(){function TextConfig(){this.text=void 0}return TextConfig.prototype.configureText=function(config,defaults){this.text=bnt.withDefault(config.text,defaults.text)},__decorate([bnt.Serializable({})],TextConfig)}();bnt.TextConfig=TextConfig}(bnt=bnt||{}),function(bnt){var DurationConfig=function(){function DurationConfig(){this.duration=void 0}return DurationConfig.prototype.configureDuration=function(durationC,defaults){this.duration=bnt.withDefault(durationC.duration,defaults.duration)},DurationConfig}();bnt.DurationConfig=DurationConfig}(bnt=bnt||{}),function(bnt){var CanvasBackgroundSize;!function(CanvasBackgroundSize){CanvasBackgroundSize.COVER="COVER",CanvasBackgroundSize.CONTAIN="CONTAIN",CanvasBackgroundSize.STRETCH="STRETCH",CanvasBackgroundSize.AUTO="AUTO"}(CanvasBackgroundSize=bnt.CanvasBackgroundSize||(bnt.CanvasBackgroundSize={})),bnt.getCanvasBackgroundSizeCSS=function(size){switch(size){case CanvasBackgroundSize.COVER:return"cover";case CanvasBackgroundSize.CONTAIN:return"contain";case CanvasBackgroundSize.STRETCH:return"100% 100%";case CanvasBackgroundSize.AUTO:return"100% auto";default:return"cover"}};var CanvasBackgroundConfig=function(){function CanvasBackgroundConfig(){}return CanvasBackgroundConfig.prototype.configureCanvasBackground=function(_c,defaults){var _b;this.canvasBackgroundColor=null!==(_b=_c.canvasBackgroundColor)&&void 0!==_b?_b:defaults.canvasBackgroundColor,this.canvasBackgroundImage=null!==(_b=_c.canvasBackgroundImage)&&void 0!==_b?_b:defaults.canvasBackgroundImage,this.canvasBackgroundSize=null!==(_c=_c.canvasBackgroundSize)&&void 0!==_c?_c:defaults.canvasBackgroundSize},CanvasBackgroundConfig}();bnt.CanvasBackgroundConfig=CanvasBackgroundConfig}(bnt=bnt||{}),function(bnt){var DimensionConfig=function(){function DimensionConfig(){}return DimensionConfig.prototype.configureDimension=function(dimension,defaults){this.width=bnt.withDefault(dimension.width,defaults.width),this.height=bnt.withDefault(dimension.height,defaults.height),this.preserveAspectRatio=bnt.withDefault(dimension.preserveAspectRatio,defaults.preserveAspectRatio),this.aspectRatio=bnt.withDefault(dimension.aspectRatio,defaults.aspectRatio)},__decorate([bnt.Serializable({})],DimensionConfig)}();bnt.DimensionConfig=DimensionConfig}(bnt=bnt||{}),function(bnt){var SrcConfig=function(){function SrcConfig(){}return SrcConfig.prototype.configureSrc=function(config,defaults){this.src=bnt.withDefault(config.src,defaults.src)},__decorate([bnt.Serializable({})],SrcConfig)}();bnt.SrcConfig=SrcConfig}(bnt=bnt||{}),function(bnt){var CoverConfig=function(){function CoverConfig(){}return CoverConfig.prototype.configureCover=function(config,defaults){this.cover=bnt.withDefault(config.cover,defaults.cover)},__decorate([bnt.Serializable({})],CoverConfig)}();bnt.CoverConfig=CoverConfig}(bnt=bnt||{}),function(bnt){var HoverImageConfig=function(){function HoverImageConfig(){}return HoverImageConfig.prototype.configureHoverImage=function(config,defaults){this.hoverImage=bnt.withDefault(config.hoverImage,defaults.hoverImage)},__decorate([bnt.Serializable({})],HoverImageConfig)}();bnt.HoverImageConfig=HoverImageConfig}(bnt=bnt||{}),function(bnt){!function(TextAlign){TextAlign.LEFT="left",TextAlign.CENTER="center",TextAlign.RIGHT="right",TextAlign.JUSTIFY="justify"}(bnt.TextAlign||(bnt.TextAlign={})),function(TextVerticalAlign){TextVerticalAlign.TOP="top",TextVerticalAlign.CENTER="center",TextVerticalAlign.BOTTOM="bottom"}(bnt.TextVerticalAlign||(bnt.TextVerticalAlign={}));var TextFormattingConfig=function(){function TextFormattingConfig(){}return TextFormattingConfig.prototype.configureTextFormatting=function(config,defaults){this.color=bnt.withDefault(config.color,defaults.color),this.textAlign=bnt.withDefault(config.textAlign,defaults.textAlign),this.textVerticalAlign=bnt.withDefault(config.textVerticalAlign,defaults.textVerticalAlign),this.fontFamily=bnt.withDefault(config.fontFamily,defaults.fontFamily),this.fontWeight=bnt.withDefault(config.fontWeight,defaults.fontWeight),this.fontStyle=bnt.withDefault(config.fontStyle,defaults.fontStyle),this.lineHeight=bnt.withDefault(config.lineHeight,defaults.lineHeight),this.textDecoration=bnt.withDefault(config.textDecoration,defaults.textDecoration),this.fontSize=bnt.withDefault(config.fontSize,defaults.fontSize),this.letterSpacing=bnt.withDefault(config.letterSpacing,defaults.letterSpacing),this.textTransform=bnt.withDefault(config.textTransform,defaults.textTransform),this.textShadow=bnt.withDefault(config.textShadow,defaults.textShadow),this.textOutline=bnt.withDefault(config.textOutline,defaults.textOutline),this.textBackgroundColor=bnt.withDefault(config.textBackgroundColor,defaults.textBackgroundColor)},__decorate([bnt.Serializable({})],TextFormattingConfig)}();bnt.TextFormattingConfig=TextFormattingConfig}(bnt=bnt||{}),function(bnt){var RotationConfig=function(){function RotationConfig(){}return RotationConfig.prototype.configureAngle=function(rotation,defaults){this.angle=bnt.withDefault(rotation.angle,defaults.angle)},__decorate([bnt.Serializable({})],RotationConfig)}();bnt.RotationConfig=RotationConfig}(bnt=bnt||{}),function(bnt){var PanConfig=function(){function PanConfig(){}return PanConfig.prototype.configurePan=function(config,defaults){this.panActive=bnt.withDefault(config.panActive,defaults.panActive),this.useGyroscope=bnt.withDefault(config.useGyroscope,defaults.useGyroscope),this.usePointer=bnt.withDefault(config.usePointer,defaults.usePointer)},__decorate([bnt.Serializable({})],PanConfig)}();bnt.PanConfig=PanConfig}(bnt=bnt||{}),function(bnt){var CanvasConfig=function(){function CanvasConfig(config){this.configureCanvas(config=void 0===config?{}:config)}return CanvasConfig.prototype.configureCanvas=function(config){this.configureDimension(config=void 0===config?{}:config,bnt.Defaults.canvas),this.name=bnt.withDefault(config.name,bnt.Defaults.canvas.name)},__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.DimensionConfig),__metadata("design:paramtypes",[Object])],CanvasConfig)}();bnt.CanvasConfig=CanvasConfig}(bnt=bnt||{}),function(bnt){var SegmentConfig=function(){function SegmentConfig(config){this.configureSegment(config=void 0===config?{}:config)}return SegmentConfig.prototype.configureSegment=function(config){this.name=bnt.withDefault((config=void 0===config?{}:config).name,bnt.Defaults.segment.name),this.readonly=bnt.withDefault(config.readonly,bnt.Defaults.segment.readonly)},__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],SegmentConfig)}();bnt.SegmentConfig=SegmentConfig}(bnt=bnt||{}),function(bnt){var animationDefault={name:"",duration:.4,delay:0,ease:"linear",repeat:1};bnt.Defaults={canvas:{name:"Landscape video",width:1280,height:720},animation:Object.assign({},animationDefault),screen:{onShow:Object.assign({},animationDefault),onHide:Object.assign({},animationDefault),duration:15,canvasBackgroundColor:void 0,canvasBackgroundImage:void 0,canvasBackgroundSize:bnt.CanvasBackgroundSize.COVER},video:{width:320,height:180,preserveAspectRatio:!1,aspectRatio:null,angle:0,src:"",autoplay:!0,mute:!1,cover:"",visible:!0,opacity:1,panActive:!1,useGyroscope:!0,usePointer:!0,videoWidth:0,videoHeight:0,videoDuration:0,coverWidth:0,coverHeight:0,soundIconConfigured:!1,soundIconVisible:!1,soundIconColor:"#ffffff",soundIconSize:40,soundIconBackgroundColor:"#000000",soundIconBackgroundSize:0,soundIconX:0,soundIconY:0,soundIconHiddenScreens:""},image:{width:100,height:100,preserveAspectRatio:!1,aspectRatio:null,src:"",hoverImage:"",angle:0,visible:!0,opacity:1,panActive:!1,useGyroscope:!0,usePointer:!0,imageWidth:0,imageHeight:0},closeButton:{width:50,height:50,preserveAspectRatio:!1,aspectRatio:null},htmlBox:{width:200,height:100,preserveAspectRatio:!1,aspectRatio:null,angle:0,visible:!0},textBox:{text:"textbox",width:150,height:50,preserveAspectRatio:!1,aspectRatio:null,angle:0,visible:!0,opacity:1},textFormatting:{color:"#000",textAlign:bnt.TextAlign.LEFT,textVerticalAlign:bnt.TextVerticalAlign.TOP,fontFamily:"Arial",fontWeight:"normal",fontStyle:"normal",fontSize:16,lineHeight:void 0,letterSpacing:void 0,textTransform:"none",textDecoration:"none",textShadow:void 0,textBackgroundColor:void 0},elementOnScreen:{x:0,y:0,zIndex:0,onHide:Object.assign({},animationDefault),onShow:Object.assign({},animationDefault)},shape:{width:100,height:100,preserveAspectRatio:!1,aspectRatio:null,backgroundColor:"#ccc",radius:0,border:1,borderColor:"#aaa",angle:0,visible:!0,opacity:1},hotspot:{width:100,height:100,preserveAspectRatio:!1,aspectRatio:null,radius:0,angle:0,visible:!0},text:{text:"textbox"},segment:{name:"Unnamed Segment",readonly:!1},subtitle:{width:350,height:100,preserveAspectRatio:!1,aspectRatio:null,angle:0,src:"",targetVideo:void 0,visibleOnMute:!1,visible:!1,opacity:1,subtitleActions:[]},group:{x:0,y:0,width:0,height:0,angle:0,visible:!0,opacity:1,onHide:Object.assign({},animationDefault),onShow:Object.assign({},animationDefault)}}}(bnt=bnt||{}),function(bnt){var TrackingSamplingLevel;!function(TrackingSamplingLevel){TrackingSamplingLevel[TrackingSamplingLevel.Off=0]="Off",TrackingSamplingLevel[TrackingSamplingLevel.Auto=1]="Auto",TrackingSamplingLevel[TrackingSamplingLevel.Full=2]="Full"}(TrackingSamplingLevel=bnt.TrackingSamplingLevel||(bnt.TrackingSamplingLevel={}));var CreativeConfig=function(){function CreativeConfig(config){this.options=(config=void 0===config?{}:config).options,this.trackingSamplingLevel=config.trackingSamplingLevel||TrackingSamplingLevel.Auto}return __decorate([bnt.Serializable({}),__metadata("design:paramtypes",[Object])],CreativeConfig)}();bnt.CreativeConfig=CreativeConfig}(bnt=bnt||{}),function(bnt){var TransitionConfig=function(){function TransitionConfig(){}return TransitionConfig.prototype.configureOnHide=function(config){this.onHide=new bnt.AnimationConfig(config)},TransitionConfig.prototype.configureOnShow=function(config){this.onShow=new bnt.AnimationConfig(config)},__decorate([bnt.Serializable({})],TransitionConfig)}();bnt.TransitionConfig=TransitionConfig}(bnt=bnt||{}),function(bnt){var VisibilityConfig=function(){function VisibilityConfig(){}return VisibilityConfig.prototype.configureVisibility=function(config,defaults){this.visible=bnt.withDefault(config.visible,defaults.visible)},__decorate([bnt.Serializable({})],VisibilityConfig)}();bnt.VisibilityConfig=VisibilityConfig}(bnt=bnt||{}),function(bnt){var OpacityConfig=function(){function OpacityConfig(){}return OpacityConfig.prototype.configureOpacity=function(config,defaults){this.opacity=bnt.withDefault(config.opacity,defaults.opacity)},__decorate([bnt.Serializable({})],OpacityConfig)}();bnt.OpacityConfig=OpacityConfig}(bnt=bnt||{}),function(bnt){var ScreenConfig=function(){function ScreenConfig(config){this.configureOnHide((config=void 0===config?{}:config).onHide),this.configureOnShow(config.onShow),this.configureDuration(config,bnt.Defaults.screen),this.configureCanvasBackground(config,bnt.Defaults.screen)}return __decorate([bnt.Mixin(bnt.TransitionConfig,bnt.DurationConfig,bnt.CanvasBackgroundConfig),bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],ScreenConfig)}();bnt.ScreenConfig=ScreenConfig}(bnt=bnt||{}),function(bnt){var Code=function(){function Code(){this.css="",this.js=""}return __decorate([bnt.Serializable({})],Code)}();bnt.Code=Code}(bnt=bnt||{}),function(bnt){var Signal=function(_super){function SignalHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(SignalHash,_super),SignalHash.prototype.hash=function(signal){return signal.hash()},__decorate([bnt.Serializable({})],SignalHash)}(bnt.HashFn);bnt.SignalHash=Signal;var SignalTypes,Signal=function(){function Signal(){var _this=this;this.id=bnt.IdClass.getNext(),bnt.QueryParams.onChange.addObserver(function(){if(bnt.QueryParams.has(Signal.queryParamsKey)&&bnt.QueryParams.get(Signal.queryParamsKey).hasOwnProperty(_this.signalName)&&bnt.QueryParams.get(Signal.queryParamsKey)[_this.signalName]!=_this.constructor.value.value){_this.constructor.forceBlockUpdate=!0;var value=bnt.QueryParams.get(Signal.queryParamsKey)[_this.signalName];try{value=JSON.parse(value)}catch(err){}JSON.stringify(_this.constructor.value.value)!=JSON.stringify(value)&&_this.constructor.value.update(value)}})}return Signal.update=function(noDeps){void 0===noDeps&&(noDeps=!1);for(var args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i]},Signal.loop=function(ctor,updateFn,seconds){void 0===seconds&&(seconds=1),ctor.forceBlockUpdate||updateFn(),setTimeout(Signal.loop.bind(this,ctor,updateFn,seconds),1e3*seconds)},Signal.init=function(noDeps){void 0===noDeps&&(noDeps=!1)},Signal.prototype.hash=function(){return bnt.fnName(this.constructor)},Signal.prototype.sameTypeAs=function(signal){return this.constructor==signal.constructor},Signal.queryParamsKey="signals",Signal.signalName="Signal",Signal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],Signal.prototype,"id",void 0),__decorate([bnt.Transient,__metadata("design:type",String)],Signal,"signalName",void 0),Signal}();bnt.Signal=Signal,bnt.signals={},function(SignalTypes){SignalTypes[SignalTypes.General=0]="General",SignalTypes[SignalTypes.Teads=1]="Teads"}(SignalTypes=bnt.SignalTypes||(bnt.SignalTypes={})),bnt.RegisterSignal=function(){for(var signalType=[],_i=0;_i<arguments.length;_i++)signalType[_i]=arguments[_i];return function(ctor){signalType.forEach(function(type){bnt.signals[SignalTypes[type]]||(bnt.signals[SignalTypes[type]]=[]),-1==bnt.signals[SignalTypes[type]].indexOf(ctor)&&bnt.signals[SignalTypes[type]].push(ctor)})}}}(bnt=bnt||{}),function(bnt){var TimeSignal=function(_super){function TimeSignal(){var _this=_super.call(this)||this;return _this.signalName=TimeSignal_1.signalName,_this.timeTable=[],TimeSignal_1.update(),_this}var TimeSignal_1;return __extends(TimeSignal,_super),(TimeSignal_1=TimeSignal).prototype.isActive=function(){return TimeSignal_1.value.value&&-1!=TimeSignal_1.value.value.day&&this.timeTable.length>TimeSignal_1.value.value.day&&this.timeTable[TimeSignal_1.value.value.day].length>TimeSignal_1.value.value.hour&&this.timeTable[TimeSignal_1.value.value.day][TimeSignal_1.value.value.hour]},TimeSignal.update=function(){var day,hour;TimeSignal_1.forceBlockUpdate||(day=(hour=new Date).getDay(),hour=hour.getHours(),TimeSignal_1.value.value&&day==TimeSignal_1.value.value.day&&hour==TimeSignal_1.value.value.hour||TimeSignal_1.value.update({day:day,hour:hour}))},TimeSignal.prototype.hash=function(){return _super.prototype.hash.call(this)+"_"+bnt.StringArrayHash.hash([this.timetableToString()])},TimeSignal.prototype.timetableToString=function(){for(var tt="",day=0;day<7;day++)for(var hour=0;hour<24;hour++)tt+=this.timeTable.length>day&&this.timeTable[day].length>hour&&this.timeTable[day][hour]?"1":"0";return tt},TimeSignal.init=function(){bnt.Signal.loop(this,TimeSignal_1.update,1)},TimeSignal.prototype.equals=function(signal){return signal.timetableToString()==this.timetableToString()},TimeSignal.signalName="Time Signal",TimeSignal.value=new bnt.ObservableValue,TimeSignal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],TimeSignal,"signalName",void 0),TimeSignal_1=__decorate([bnt.RegisterSignal(bnt.SignalTypes.General,bnt.SignalTypes.Teads),bnt.Serializable({}),__metadata("design:paramtypes",[])],TimeSignal)}(bnt.Signal);bnt.TimeSignal=TimeSignal}(bnt=bnt||{}),function(bnt){var DateType;!function(DateType){DateType[DateType.Before=0]="Before",DateType[DateType.Between=1]="Between",DateType[DateType.After=2]="After"}(DateType=bnt.DateType||(bnt.DateType={}));var DateSignal=function(_super){function DateSignal(){var _this=_super.call(this)||this;return _this.signalName=DateSignal_1.signalName,_this.dateType=DateType.Between,DateSignal_1.update(),_this}var DateSignal_1;return __extends(DateSignal,_super),(DateSignal_1=DateSignal).prototype.isActive=function(){var fromDate=new Date(this.fromDateRaw).getTime(),toDate=new Date(this.toDateRaw).getTime();return this.dateType==DateType.After?DateSignal_1.value.value>fromDate:this.dateType==DateType.Before?DateSignal_1.value.value<toDate:this.dateType==DateType.Between&&(fromDate==toDate&&(toDate+=86399e3),DateSignal_1.value.value>=fromDate&&DateSignal_1.value.value<=toDate)},DateSignal.update=function(){var date;DateSignal_1.forceBlockUpdate||(date=Date.now())!=DateSignal_1.value.value&&DateSignal_1.value.update(date)},DateSignal.init=function(){bnt.Signal.loop(this,DateSignal_1.update,1)},DateSignal.prototype.equals=function(signal){return signal.fromDateRaw==this.fromDateRaw&&signal.toDateRaw==this.toDateRaw},DateSignal.signalName="Date Signal",DateSignal.value=new bnt.ObservableValue,DateSignal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],DateSignal,"signalName",void 0),DateSignal_1=__decorate([bnt.RegisterSignal(bnt.SignalTypes.General,bnt.SignalTypes.Teads),bnt.Serializable({}),__metadata("design:paramtypes",[])],DateSignal)}(bnt.Signal);bnt.DateSignal=DateSignal}(bnt=bnt||{}),function(bnt){var LocationData=function(){function LocationData(){}return LocationData.init=function(){var _this=this;if(this.loaded)return bnt.Promise.fulfilledWith(null).future;var p=new bnt.Promise;this.loaded=!0;var xhr=new XMLHttpRequest;return xhr.open("GET",this.serviceUrl,!0),xhr.addEventListener("load",function(evt){var response=xhr.responseText.split("|");Object.keys(_this.geoip).forEach(function(key,index){null==response[index]||""==response[index]?_this.geoip[key]="Unknown":_this.geoip[key]=response[index]}),p.succeed(null)}),xhr.addEventListener("error",function(evt){p.fail(new Error("Location service encountered an error!"))}),xhr.send(),p.future},LocationData.getCountry=function(){var _this=this,p=new bnt.Promise;return this.init().map(function(){return p.succeed(_this.geoip.country_name)}),p.future},LocationData.getCity=function(){var _this=this,p=new bnt.Promise;return this.init().map(function(){return p.succeed(_this.geoip.city)}),p.future},LocationData.getLatitude=function(){var _this=this,p=new bnt.Promise;return this.init().map(function(){return p.succeed(_this.geoip.latitude)}),p.future},LocationData.getLongitude=function(){var _this=this,p=new bnt.Promise;return this.init().map(function(){return p.succeed(_this.geoip.longitude)}),p.future},LocationData.serviceUrl="https://s8t.teads.tv/geoip",LocationData.loaded=!1,LocationData.geoip={continent_code:"",country_name:"",city:"",region:"",postal_code:"",latitude:"",longitude:""},LocationData}();bnt.LocationData=LocationData}(bnt=bnt||{}),function(bnt){var TeadsLocationSignal=function(_super){function TeadsLocationSignal(){var _this=_super.apply(this,__spreadArray([],__read(arguments),!1))||this;return _this.signalName=TeadsLocationSignal_1.signalName,_this.locations=[],_this}var TeadsLocationSignal_1;return __extends(TeadsLocationSignal,_super),(TeadsLocationSignal_1=TeadsLocationSignal).prototype.isActive=function(){var e_4,_a;if(!TeadsLocationSignal_1.value.value)return!1;try{for(var _b=__values(this.locations),_c=_b.next();!_c.done;_c=_b.next()){var location_1=_c.value;if(TeadsLocationSignal_1.value.value[location_1.type]==location_1[location_1.type].id)return!0}}catch(e_4_1){e_4={error:e_4_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_4)throw e_4.error}}return!1},TeadsLocationSignal.prototype.hash=function(){return _super.prototype.hash.call(this)+"_"+bnt.StringArrayHash.hash(this.locations.map(function(l){return l[l.type].code}))},TeadsLocationSignal.prototype.equals=function(signal){var e_5,_a,e_6,_b;if(signal.locations.length!=this.locations.length)return!1;try{for(var _c=__values(this.locations),_d=_c.next();!_d.done;_d=_c.next()){var location_2=_d.value,k=!0;try{for(var _e=(e_6=void 0,__values(signal.locations)),_f=_e.next();!_f.done;_f=_e.next()){var otherLocation=_f.value;if(location_2[location_2.type].code==otherLocation[otherLocation.type].code){k=!1;break}}}catch(e_6_1){e_6={error:e_6_1}}finally{try{_f&&!_f.done&&(_b=_e.return)&&_b.call(_e)}finally{if(e_6)throw e_6.error}}if(k)return!1}}catch(e_5_1){e_5={error:e_5_1}}finally{try{_d&&!_d.done&&(_a=_c.return)&&_a.call(_c)}finally{if(e_5)throw e_5.error}}return!0},TeadsLocationSignal.update=function(noDeps){void 0===noDeps&&(noDeps=!1),TeadsLocationSignal_1.forceBlockUpdate||(noDeps?TeadsLocationSignal_1.value.update({}):bnt.TeadsPlayerAddons.apiProxy.addObserver(function(api){api?api.getContextData().map(function(userContext){var locations={};userContext&&userContext.context&&userContext.context.user&&(locations={continent:(userContext=userContext.context.user)["de-continent"],country:userContext["de-country"],city:userContext["de-city"],region:userContext["de-region"]}),TeadsLocationSignal_1.value.update(locations)}):TeadsLocationSignal_1.value.update({})}))},TeadsLocationSignal.init=function(noDeps){TeadsLocationSignal_1.update(noDeps=void 0===noDeps?!1:noDeps)},TeadsLocationSignal.signalName="Teads Location Signal",TeadsLocationSignal.value=new bnt.ObservableValue,TeadsLocationSignal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],TeadsLocationSignal,"signalName",void 0),TeadsLocationSignal_1=__decorate([bnt.RegisterSignal(bnt.SignalTypes.Teads),bnt.Serializable({})],TeadsLocationSignal)}(bnt.Signal);bnt.TeadsLocationSignal=TeadsLocationSignal}(bnt=bnt||{}),function(bnt){var Device,Platform;!function(Device){Device[Device.Mobile=0]="Mobile",Device[Device.Tablet=1]="Tablet",Device[Device.Desktop=2]="Desktop"}(Device=bnt.Device||(bnt.Device={})),function(Platform){Platform[Platform.Windows=0]="Windows",Platform[Platform.macOS=1]="macOS",Platform[Platform.Linux=2]="Linux",Platform[Platform.Android=3]="Android",Platform[Platform.iOS=4]="iOS",Platform[Platform.WindowsMobile=5]="WindowsMobile"}(Platform=bnt.Platform||(bnt.Platform={}));var DeviceAndPlatformSignal=function(_super){function DeviceAndPlatformSignal(){var _this=_super.apply(this,__spreadArray([],__read(arguments),!1))||this;return _this.signalName=DeviceAndPlatformSignal_1.signalName,_this.deviceAndPlatformData={Mobile:{selected:!1,platforms:[]},Tablet:{selected:!1,platforms:[]},Desktop:{selected:!1,platforms:[]}},_this}var DeviceAndPlatformSignal_1;return __extends(DeviceAndPlatformSignal,_super),(DeviceAndPlatformSignal_1=DeviceAndPlatformSignal).prototype.isActive=function(){var activePlatform=Device[DeviceAndPlatformSignal_1.value.value.device],signalDevice=this.deviceAndPlatformData[activePlatform],activePlatform=DeviceAndPlatformSignal_1.value.value.platform;return signalDevice&&signalDevice.selected&&(void 0!==activePlatform&&-1!=signalDevice.platforms.indexOf(activePlatform)||void 0===activePlatform)},DeviceAndPlatformSignal.prototype.hash=function(){var _this=this,forHash=Object.keys(this.deviceAndPlatformData).map(function(k){return _this.deviceAndPlatformData[k].selected?__spreadArray([k],__read(_this.deviceAndPlatformData[k].platforms),!1):[]}).reduce(function(a,c){return __spreadArray(__spreadArray([],__read(a),!1),__read(c),!1)},[]).map(function(v){return v.toString()});return _super.prototype.hash.call(this)+"_"+bnt.StringArrayHash.hash(forHash)},DeviceAndPlatformSignal.prototype.equals=function(signal){var e_7,_a;try{for(var _b=__values(Object.keys(this.deviceAndPlatformData)),_c=_b.next();!_c.done;_c=_b.next()){var deviceType=_c.value,one=signal.deviceAndPlatformData[deviceType],two=this.deviceAndPlatformData[deviceType];if(one.selected!=two.selected||!this.equalPlatforms(one.platforms,two.platforms))return!1}}catch(e_7_1){e_7={error:e_7_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_7)throw e_7.error}}return!0},DeviceAndPlatformSignal.prototype.equalPlatforms=function(one,two){if(one.length!=two.length)return!1;one=one.sort(),two=two.sort();for(var i=0;i<one.length;i++)if(one[i]!=two[i])return!1;return!0},DeviceAndPlatformSignal.update=function(){var device,platform;DeviceAndPlatformSignal_1.forceBlockUpdate||(device=this.getDeviceType(),platform=this.getPlatformType(DeviceContext.getOS().name),DeviceAndPlatformSignal_1.value.value&&DeviceAndPlatformSignal_1.value.value.platform==platform&&DeviceAndPlatformSignal_1.value.value.device==device||DeviceAndPlatformSignal_1.value.update({device:device,platform:platform}))},DeviceAndPlatformSignal.init=function(){DeviceAndPlatformSignal_1.update()},DeviceAndPlatformSignal.getDeviceType=function(){return DeviceContext.isDesktop()?Device.Desktop:DeviceContext.isMobile()?Device.Mobile:DeviceContext.isTablet()?Device.Tablet:void 0},DeviceAndPlatformSignal.getPlatformType=function(platformType){return"android"==(platformType=platformType.toLowerCase())?Platform.Android:"ios"==platformType?Platform.iOS:"windows mobile"==platformType?Platform.WindowsMobile:"windows"==platformType?Platform.Windows:"mac os"==platformType?Platform.macOS:"linux"==platformType?Platform.Linux:void 0},DeviceAndPlatformSignal.isMobile=function(){return DeviceContext.isMobile()},DeviceAndPlatformSignal.signalName="Device and platform Signal",DeviceAndPlatformSignal.value=new bnt.ObservableValue,DeviceAndPlatformSignal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],DeviceAndPlatformSignal,"signalName",void 0),DeviceAndPlatformSignal_1=__decorate([bnt.RegisterSignal(bnt.SignalTypes.General,bnt.SignalTypes.Teads),bnt.Serializable({})],DeviceAndPlatformSignal)}(bnt.Signal);bnt.DeviceAndPlatformSignal=DeviceAndPlatformSignal}(bnt=bnt||{}),function(bnt){var Operator;!function(Operator){Operator[Operator.Less=0]="Less",Operator[Operator.Greater=1]="Greater",Operator[Operator.Equal=2]="Equal",Operator[Operator.NotEqual=3]="NotEqual"}(Operator=bnt.Operator||(bnt.Operator={}));var DynamicDataSignal=function(_super){function DynamicDataSignal(){var _this=_super.call(this)||this;return _this.signalName=DynamicDataSignal_1.signalName,DynamicDataSignal_1.update(),_this}var DynamicDataSignal_1;return __extends(DynamicDataSignal,_super),(DynamicDataSignal_1=DynamicDataSignal).prototype.isActive=function(){return!!bnt.DynamicData.hasData(this.key)&&this.compareValue(bnt.DynamicData.getData(this.key),this.value,this.operator)},DynamicDataSignal.prototype.compareValue=function(value1,value2,operator){var v1=value1,v2=value2;switch(parseInt(value1)+""==value1.toString()&&parseInt(value2)+""==value2.toString()&&(v1=parseInt(value1),v2=parseInt(value2)),operator){case Operator.Equal:return v1==v2;case Operator.Greater:return v2<v1;case Operator.Less:return v1<v2;default:return v1!=v2}},DynamicDataSignal.prototype.equals=function(signal){return signal instanceof DynamicDataSignal_1&&this.key==signal.key&&this.value==signal.value&&this.operator==signal.operator},DynamicDataSignal.update=function(){DynamicDataSignal_1.forceBlockUpdate||(DynamicDataSignal_1.value.update(!0),bnt.DynamicData.onDataChange.addObserver(function(){DynamicDataSignal_1.value.update(!0)}))},DynamicDataSignal.signalName="Dynamic Data Signal",DynamicDataSignal.value=new bnt.ObservableValue,__decorate([bnt.Transient,__metadata("design:type",String)],DynamicDataSignal,"signalName",void 0),DynamicDataSignal_1=__decorate([bnt.RegisterSignal(bnt.SignalTypes.General,bnt.SignalTypes.Teads),bnt.Serializable({}),__metadata("design:paramtypes",[])],DynamicDataSignal)}(bnt.Signal);bnt.DynamicDataSignal=DynamicDataSignal}(bnt=bnt||{}),function(bnt){var TeadsAudienceSignal=function(_super){function TeadsAudienceSignal(){var _this=_super.apply(this,__spreadArray([],__read(arguments),!1))||this;return _this.signalName=TeadsAudienceSignal_1.signalName,_this.values=[],_this}var TeadsAudienceSignal_1;return __extends(TeadsAudienceSignal,_super),(TeadsAudienceSignal_1=TeadsAudienceSignal).prototype.isActive=function(){var e_8,_a;this.values.sort(function(a,b){return a.id-b.id});var k=0,theValues=TeadsAudienceSignal_1.value.value;try{for(var _b=__values(this.values),_c=_b.next();!_c.done;_c=_b.next()){for(var v=_c.value;k<theValues.length&&v.id>theValues[k].id;)k++;if(k==theValues.length)return!1;if(v.id==theValues[k].id)return!0}}catch(e_8_1){e_8={error:e_8_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_8)throw e_8.error}}return!1},TeadsAudienceSignal.prototype.hash=function(){return _super.prototype.hash.call(this)+"_"+bnt.StringArrayHash.hash(this.values.map(function(a){return""+a.id}))},TeadsAudienceSignal.prototype.equals=function(signal){if(signal.values.length!=this.values.length)return!1;function sortFn(a,b){return a.id-b.id}signal.values.sort(sortFn),this.values.sort(sortFn);for(var i=0;i<signal.values.length;i++)if(signal.values[i].id!=this.values[i].id)return!1;return!0},TeadsAudienceSignal.update=function(noDeps){void 0===noDeps&&(noDeps=!1),TeadsAudienceSignal_1.forceBlockUpdate||(noDeps?TeadsAudienceSignal_1.value.update([]):bnt.TeadsPlayerAddons.apiProxy.addObserver(function(api){api?bnt.TeadsPlayerAddons.apiProxy.value.getContextData().map(function(ctx){ctx&&ctx.context&&ctx.context.user&&ctx.context.user["exelate-segments"]?TeadsAudienceSignal_1.value.update(ctx.context.user["exelate-segments"].map(parseInt).map(function(id){return{id:id}}).sort(function(a,b){return a.id-b.id})):TeadsAudienceSignal_1.value.update([])}):TeadsAudienceSignal_1.value.update([])}))},TeadsAudienceSignal.init=function(noDeps){TeadsAudienceSignal_1.update(noDeps=void 0===noDeps?!1:noDeps)},TeadsAudienceSignal.signalName="Audience Signal",TeadsAudienceSignal.value=new bnt.ObservableValue([]),TeadsAudienceSignal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],TeadsAudienceSignal,"signalName",void 0),TeadsAudienceSignal_1=__decorate([bnt.Serializable({})],TeadsAudienceSignal)}(bnt.Signal);bnt.TeadsAudienceSignal=TeadsAudienceSignal}(bnt=bnt||{}),function(bnt){var TeadsGrapeshotSignal=function(_super){function TeadsGrapeshotSignal(){var _this=_super.apply(this,__spreadArray([],__read(arguments),!1))||this;return _this.signalName=TeadsGrapeshotSignal_1.signalName,_this.values=[],_this}var TeadsGrapeshotSignal_1;return __extends(TeadsGrapeshotSignal,_super),(TeadsGrapeshotSignal_1=TeadsGrapeshotSignal).prototype.isActive=function(){var e_9,_a;try{for(var _b=__values(TeadsGrapeshotSignal_1.value.value),_c=_b.next();!_c.done;_c=_b.next()){var value=_c.value;if(~this.values.indexOf(value))return!0}}catch(e_9_1){e_9={error:e_9_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_9)throw e_9.error}}return!1},TeadsGrapeshotSignal.prototype.hash=function(){return _super.prototype.hash.call(this)+"_"+bnt.StringArrayHash.hash(this.values)},TeadsGrapeshotSignal.prototype.equals=function(signal){if(signal.values.length!=this.values.length)return!1;for(var i=0;i<this.values.length;i++)if(-1==signal.values.indexOf(this.values[i]))return!1;return!0},TeadsGrapeshotSignal.update=function(noDeps){void 0===noDeps&&(noDeps=!1),TeadsGrapeshotSignal_1.forceBlockUpdate||(noDeps?TeadsGrapeshotSignal_1.value.update([]):bnt.TeadsPlayerAddons.apiProxy.addObserver(function(api){api?bnt.TeadsPlayerAddons.apiProxy.value.getContextData().map(function(ctx){ctx&&ctx.context&&ctx.context.page&&ctx.context.page.grapeshotKeywords?TeadsGrapeshotSignal_1.value.update(ctx.context.page.grapeshotKeywords):TeadsGrapeshotSignal_1.value.update([])}):TeadsGrapeshotSignal_1.value.update([])}))},TeadsGrapeshotSignal.init=function(noDeps){TeadsGrapeshotSignal_1.update(noDeps=void 0===noDeps?!1:noDeps)},TeadsGrapeshotSignal.signalName="Grapeshot Signal",TeadsGrapeshotSignal.value=new bnt.ObservableValue([]),TeadsGrapeshotSignal.forceBlockUpdate=!1,__decorate([bnt.Transient,__metadata("design:type",String)],TeadsGrapeshotSignal,"signalName",void 0),TeadsGrapeshotSignal_1=__decorate([bnt.Serializable({})],TeadsGrapeshotSignal)}(bnt.Signal);bnt.TeadsGrapeshotSignal=TeadsGrapeshotSignal}(bnt=bnt||{}),function(bnt){var State=function(_super){function StateHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(StateHash,_super),StateHash.prototype.hash=function(state){return state.hash()},__decorate([bnt.Serializable({})],StateHash)}(bnt.HashFn);bnt.StateHash=State;State=function(){function State(state){var _this=this;this.hash=function(){return _this.canvas.hash()+"_"+_this.segment.hash()},this.id=bnt.IdClass.getNext(),this.canvas=state&&state.canvas||void 0,this.segment=state&&state.segment||void 0}return __decorate([bnt.Transient,__metadata("design:type",String)],State.prototype,"id",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],State)}();bnt.State=State}(bnt=bnt||{}),function(bnt){var Canvas=function(_super){function CanvasHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(CanvasHash,_super),CanvasHash.prototype.hash=function(canvas){return canvas.hash()},__decorate([bnt.Serializable({})],CanvasHash)}(bnt.HashFn);bnt.CanvasHash=Canvas;Canvas=function(){function Canvas(config){void 0===config&&(config={});var _this=this;this.getAspectRatio=function(){return _this.config.width/_this.config.height},this.hash=function(){return _this.uuid},this.config=new bnt.CanvasConfig(config),this.uuid=bnt.UUID.get()}return __decorate([bnt.Serializable({}),__metadata("design:paramtypes",[Object])],Canvas)}();bnt.Canvas=Canvas}(bnt=bnt||{}),function(bnt){var Segment=function(_super){function SegmentHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(SegmentHash,_super),SegmentHash.prototype.hash=function(segment){return segment.hash()},__decorate([bnt.Serializable({})],SegmentHash)}(bnt.HashFn);bnt.SegmentHash=Segment;Segment=function(){function Segment(config){void 0===config&&(config={});var _this=this;this.signalHolders=[],this.hash=function(){return _this.uuid},this.id=bnt.IdClass.getNext(),this.config=new bnt.SegmentConfig(config),this.uuid=bnt.UUID.get()}return Segment.prototype.equals=function(segment){if(segment.id==this.id)return!0;if(segment.signalHolders.length!=this.signalHolders.length)return!1;if(!segment.signalHolders.length)return!0;var equalSignalCount=0;return this.signalHolders.forEach(function(localSignalHolder){segment.signalHolders.forEach(function(signalHolder){localSignalHolder.signal.sameTypeAs(signalHolder.signal)&&localSignalHolder.signal.equals(signalHolder.signal)&&equalSignalCount++})}),equalSignalCount>=segment.signalHolders.length},__decorate([bnt.Transient,__metadata("design:type",String)],Segment.prototype,"id",void 0),__decorate([bnt.Serializable({}),__metadata("design:paramtypes",[Object])],Segment)}();bnt.Segment=Segment}(bnt=bnt||{}),function(bnt){var WithTimeline=function(){function WithTimeline(){this.onplay=new bnt.Observable,this.onpause=new bnt.Observable,this.onstop=new bnt.Observable,this.onend=new bnt.Observable,this.duration=new bnt.ObservableValue,this.remainingTimeMillisec=new bnt.ObservableValue(-1),this.timeMillisec=new bnt.ObservableValue,this.volume=new bnt.ObservableValue(0),this.muted=new bnt.ObservableValue}return WithTimeline.prototype.play=function(){var _this=this;return this.timeline.play().map(function(){return _this.onplay.update(void 0)})},WithTimeline.prototype.pause=function(){var _this=this;return this.timeline.pause().map(function(){return _this.onpause.update(void 0)})},WithTimeline.prototype.stop=function(){var _this=this;return this.timeline.stop().map(function(){return _this.onstop.update(void 0)})},WithTimeline.prototype.suspend=function(){return this.timeline.suspend()},WithTimeline.prototype.resume=function(){return this.timeline.resume()},WithTimeline.prototype.mute=function(){var _this=this;return this.timeline.mute().map(function(){return _this.muted.update(!0)})},WithTimeline.prototype.unmute=function(){var _this=this;return this.timeline.unmute().map(function(){return _this.muted.update(!1)})},WithTimeline}();bnt.WithTimeline=WithTimeline}(bnt=bnt||{}),function(bnt){var TeadsPlayerAddons=function(){function TeadsPlayerAddons(creative){var _this=this;this.creative=creative,TeadsPlayerAddons.inited||(TeadsPlayerAddons.inited=!0,TeadsPlayerAddons.apiProxy.addObserver(function(apiProxy){return apiProxy&&_this.activate()}),this.initializeTeadsApi())}return TeadsPlayerAddons.prototype.activate=function(){TeadsPlayerAddons.announceStudioAd(!1),TeadsPlayerAddons.apiProxy.value.performTapMode(!1);function sendVideoMetadata(width){var width=(height=width.canvas.config).width,height=height.height;TeadsPlayerAddons.apiProxy.value.sendVideoMetadata({width:width,height:height})}var fixStage_1,currentState=bnt.get(bnt.State);currentState?sendVideoMetadata(currentState):(fixStage_1=function(state){sendVideoMetadata(state),bnt.get(bnt.StateChangeDetector).stateUpdated.removeObserver(fixStage_1)},bnt.get(bnt.StateChangeDetector).stateUpdated.addObserver(fixStage_1)),TeadsPlayerAddons.listenForSensorUpdates()},TeadsPlayerAddons.announceStudioAd=function(value){function update(apixProxy){TeadsPlayerAddons.studioData.addObserver(function(value){value.display&&TeadsPlayerAddons.apiProxy.value.hideVideoContainer()}),TeadsPlayerAddons.apiProxy.value.setBackgroundColor("transparent"),TeadsPlayerAddons.apiProxy.value.getStudioData().map(function(studioData){studioData?(studioData.display=value,studioData.studio_cid=cid):studioData={display:value,studio_cid:cid},TeadsPlayerAddons.apiProxy.value.setStudioData(studioData)})}TeadsPlayerAddons.apiProxy.value?update(TeadsPlayerAddons.apiProxy.value):TeadsPlayerAddons.apiProxy.addObserver(update)},TeadsPlayerAddons.inTeadsPlayer=function(){return null!=TeadsPlayerAddons.getTeadsApi()},TeadsPlayerAddons.getWindows=function(){for(var windows=[],w=window;w!==w.parent;)w=w.parent,windows.push(w);return windows},TeadsPlayerAddons.getTeadsApi=function(){var e_10,_a;if(bnt.logger.warn("TeadsPlayerAddons.getTeadsApi is deprecated - use async TeadsPlayerAddons.apiProxy instead"),"undefined"==typeof window)return null;if(!TeadsPlayerAddons.api)try{for(var _b=__values(TeadsPlayerAddons.getWindows()),_c=_b.next();!_c.done;_c=_b.next()){var w=_c.value;try{"teads"in w&&"object"==typeof w.teads&&"api"in w.teads&&(TeadsPlayerAddons.api=w.teads.api)}catch(e){bnt.logger.warn("No access to this iframe!")}}}catch(e_10_1){e_10={error:e_10_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_10)throw e_10.error}}return TeadsPlayerAddons.api},TeadsPlayerAddons.prototype.initializeTeadsApi=function(){TeadsPlayerAddons.getTeadsApi(),TeadsPlayerAddons.api?TeadsPlayerAddons.apiProxy.update(new TeadsApiWrapper(TeadsPlayerAddons.api)):(TeadsPlayerAddons.rpcApi=new TeadsApiRPC,TeadsPlayerAddons.rpcApiSearch=TeadsPlayerAddons.rpcApi.pairWithPlayer(),TeadsPlayerAddons.rpcApiSearch.onSuccess(function(){return TeadsPlayerAddons.apiProxy.update(TeadsPlayerAddons.rpcApi)}),TeadsPlayerAddons.rpcApiSearch.onFailure(function(){return TeadsPlayerAddons.apiProxy.update(null)}))},TeadsPlayerAddons.fixVideoSlotSize=function(video){var ve=bnt.get(bnt.AdController).videoSlot;ve.style.minWidth="100%",ve.style.minHeight="100%";function fixVideoWidthHeight(){var withPan=bnt.get(bnt.State);video.getConfig(withPan).panActive?(withPan=bnt.ElementRendererRegistry.rendererFor(video)).getVideoElementWithPan()&&withPan.getVideoElementWithPan().forceUpdateLastConfig():(ve.style.width="100%",ve.style.height="100%"),clearTimeout(ve._forceRedrawInterval),ve._forceRedrawInterval=setTimeout(function(){ve.style.borderTop="1px solid rgba(0, 0, 0, 0.1)",requestAnimationFrame(function(){ve.style.borderTop=""})},1e3)}fixVideoWidthHeight(),bnt.get(bnt.ResizeController).resize.addObserver(function(size){setTimeout(function(){fixVideoWidthHeight()},0)})},TeadsPlayerAddons.callPlayerApiMethod=function(methodName,params){void 0===params&&(params=[]);var promise=new bnt.Promise;return TeadsPlayerAddons.apiProxy.addObserver(function(result){result?((result=result.callPlayerApiMethod(methodName,params)).onSuccess(function(r){return promise.succeed(r)}),result.onFailure(function(e){return promise.fail(e)})):promise.fail(new Error("Player API not available"))}),promise.future},TeadsPlayerAddons.initializeHandshake=function(){var handshakeConfirmation=new bnt.Promise;return handshakeConfirmation.future.onSuccess(function(w){TeadsPlayerAddons.pairedAdWindow=w,clearTimeout(TeadsPlayerAddons.handshakeTimeout)}),TeadsPlayerAddons.listenForHandshakeConfirmation(handshakeConfirmation),TeadsPlayerAddons.tryHandshake(handshakeConfirmation),handshakeConfirmation},TeadsPlayerAddons.sendHandshakeMessage=function(){var e_11,_a;try{for(var _b=__values(TeadsPlayerAddons.getWindows()),_c=_b.next();!_c.done;_c=_b.next())_c.value.postMessage({method:TeadsPlayerAddons.MSG_HELLO},"*")}catch(e_11_1){e_11={error:e_11_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_11)throw e_11.error}}},TeadsPlayerAddons.tryHandshake=function(handshakeConfirmation,retriesLeft){void 0===retriesLeft&&(retriesLeft=TeadsPlayerAddons.HANDSHAKE_RETRIES),TeadsPlayerAddons.sendHandshakeMessage(),TeadsPlayerAddons.handshakeTimeout=setTimeout(function(){TeadsPlayerAddons.pairedAdWindow||(--retriesLeft<=0?(handshakeConfirmation.fail(new Error("Timeout")),bnt.logger.warn("TeadsApi not found in set time interval")):TeadsPlayerAddons.tryHandshake(handshakeConfirmation,retriesLeft))},TeadsPlayerAddons.TIMEOUT)},TeadsPlayerAddons.listenForHandshakeConfirmation=function(handshakePromise){var listener=function(evt){"object"==typeof evt.data&&evt.data.method===TeadsPlayerAddons.MSG_HELLO&&(handshakePromise.fulfilled||handshakePromise.succeed(evt.source),window.removeEventListener("message",listener))};window.addEventListener("message",listener)},TeadsPlayerAddons.listenForSensorUpdates=function(){window.addEventListener("message",function(msg){"object"!=typeof msg.data||(msg=msg.data).method===TeadsPlayerAddons.SENSOR_UPDATE&&bnt.TeadsPlayerAddons.deviceSensor.update(msg.methodReturn)})},TeadsPlayerAddons.neededFunctionsNames=["getStudioData","setStudioData"],TeadsPlayerAddons.inited=!1,TeadsPlayerAddons.api=null,TeadsPlayerAddons.apiProxy=new bnt.ObservableValue,TeadsPlayerAddons.deviceSensor=new bnt.ObservableValue,TeadsPlayerAddons.studioData=new bnt.ObservableValue,TeadsPlayerAddons.brandingModeOnVoidClick=!0,TeadsPlayerAddons.TIMEOUT=50,TeadsPlayerAddons.HANDSHAKE_RETRIES=5,TeadsPlayerAddons.MSG_HELLO="studio-ad--format-RPC",TeadsPlayerAddons.SENSOR_UPDATE="-studio-ad--sensors-update",TeadsPlayerAddons}();bnt.TeadsPlayerAddons=TeadsPlayerAddons;var TeadsApiWrapper=function(){function TeadsApiWrapper(teadsApi){this.teadsApi=teadsApi,TeadsPlayerAddons.initializeHandshake()}return TeadsApiWrapper.prototype.performTapMode=function(on){return this.methodFallback("performTapMode",on)},TeadsApiWrapper.prototype.isFullscreen=function(){return this.methodFallback("isFullscreen")},TeadsApiWrapper.prototype.getContextData=function(){return this.methodFallback("getContextData")},TeadsApiWrapper.prototype.getStudioData=function(){return this.methodFallback("getStudioData")},TeadsApiWrapper.prototype.setStudioData=function(value){return TeadsPlayerAddons.studioData.update(value),this.methodFallback("setStudioData",value)},TeadsApiWrapper.prototype.isStudioDisplay=function(){return this.methodFallback("isStudioDisplay")},TeadsApiWrapper.prototype.isReplay=function(){return this.methodFallback("isReplay")},TeadsApiWrapper.prototype.requestFullscreen=function(){return this.methodFallback("requestFullscreen")},TeadsApiWrapper.prototype.setBackgroundColor=function(color){return this.methodFallback("setBackgroundColor",color)},TeadsApiWrapper.prototype.setFixedBackgroundImage=function(imageSrc){return this.methodFallback("setFixedBackgroundImage",imageSrc)},TeadsApiWrapper.prototype.hideVideoContainer=function(){return this.methodFallback("hideVideoContainer")},TeadsApiWrapper.prototype.setSoundControlVisibility=function(visible){return this.methodFallback("setSoundControlVisibility",visible)},TeadsApiWrapper.prototype.setFullscreenButtonVisibility=function(visible){return this.methodFallback("setFullscreenButtonVisibility",visible)},TeadsApiWrapper.prototype.setProgressControlVisibility=function(visible){return this.methodFallback("setProgressControlVisibility",visible)},TeadsApiWrapper.prototype.setStartScreenVisibility=function(visible){return this.methodFallback("setStartScreenVisibility",visible)},TeadsApiWrapper.prototype.getSlotBounds=function(){return this.methodFallback("getSlotBounds")},TeadsApiWrapper.prototype.sendVideoMetadata=function(metadata){return this.methodFallback("sendVideoMetadata",metadata)},TeadsApiWrapper.prototype.getSumologicOption=function(){return this.methodFallback("getSumologicOption")},TeadsApiWrapper.prototype.getUserLocation=function(successHandler,errorHandler){return this.methodFallback("getUserLocation",successHandler,errorHandler)},TeadsApiWrapper.prototype.getTeadsInfo=function(){return this.methodFallback("getTeadsInfo")},TeadsApiWrapper.prototype.addDeviceOrientationListener=function(){return this.methodFallback("addDeviceOrientationListener")},TeadsApiWrapper.prototype.sendAdClickThru=function(params){return this.methodFallback("sendAdClickThru",params)},TeadsApiWrapper.prototype.requestInterscroller=function(){return this.methodFallback("requestInterscroller")},TeadsApiWrapper.prototype.isMobile=function(){return this.methodFallback("isMobile")},TeadsApiWrapper.prototype.callPlayerApiMethod=function(methodName,params){return this.methodFallback.apply(this,__spreadArray([methodName],__read(params=void 0===params?[]:params),!1))},TeadsApiWrapper.prototype.methodFallback=function(method){for(var _a,args=[],_i=1;_i<arguments.length;_i++)args[_i-1]=arguments[_i];return this.teadsApi[method]?bnt.Promise.fulfilledWith((_a=this.teadsApi)[method].apply(_a,__spreadArray([],__read(args),!1))).future:(bnt.logger.log("Teads custom API method ".concat(bnt.fnName," is missing")),bnt.Promise.fulfilledWith(null).future)},TeadsApiWrapper}(),TeadsApiRPC=function(){function TeadsApiRPC(){var _this=this;this.runningRPCs=[],this.keepListening=!1,this.rpcCallback=function(evt){if("object"==typeof evt.data){var msg=evt.data;if(!msg.method)return;var firstRPCMatchIndex=-1;try{for(;_this.runningRPCs[++firstRPCMatchIndex].rpcData.method!=msg.method;);var match=_this.runningRPCs.splice(firstRPCMatchIndex,1)[0];match&&match.promise.succeed(msg.methodReturn||msg.error)}catch(er){bnt.logger.warn('Matching rpc not found - "'.concat(msg.method,'"'))}}_this.keepListening||_this.runningRPCs.length||window.removeEventListener("message",_this.rpcCallback)}}return TeadsApiRPC.prototype.pairWithPlayer=function(){if(TeadsPlayerAddons.pairedAdWindow)throw new Error("TeadsApiRPC is already paired");return window.addEventListener("message",this.rpcCallback),TeadsPlayerAddons.initializeHandshake().future},TeadsApiRPC.prototype.sendMessage=function(message){window.addEventListener("message",this.rpcCallback);var pr=new bnt.Promise;return this.runningRPCs.push({rpcData:message,promise:pr}),TeadsPlayerAddons.pairedAdWindow.postMessage(message,"*"),pr.future},TeadsApiRPC.prototype.performTapMode=function(on){return this.sendMessage({method:"performTapMode",methodArgs:[on]})},TeadsApiRPC.prototype.isFullscreen=function(){return this.sendMessage({method:"isFullscreen",methodArgs:[]})},TeadsApiRPC.prototype.getContextData=function(){return this.sendMessage({method:"getContextData",methodArgs:[]})},TeadsApiRPC.prototype.getStudioData=function(){return this.sendMessage({method:"getStudioData",methodArgs:[]})},TeadsApiRPC.prototype.setStudioData=function(value){return TeadsPlayerAddons.studioData.update(value),this.sendMessage({method:"setStudioData",methodArgs:[value]})},TeadsApiRPC.prototype.isStudioDisplay=function(){return this.sendMessage({method:"isStudioDisplay",methodArgs:[]})},TeadsApiRPC.prototype.isReplay=function(){return this.sendMessage({method:"isReplay",methodArgs:[]})},TeadsApiRPC.prototype.requestFullscreen=function(){return this.sendMessage({method:"requestFullscreen",methodArgs:[]})},TeadsApiRPC.prototype.setBackgroundColor=function(color){return this.sendMessage({method:"setBackgroundColor",methodArgs:[color]})},TeadsApiRPC.prototype.setFixedBackgroundImage=function(imageSrc){return this.sendMessage({method:"setFixedBackgroundImage",methodArgs:[imageSrc]})},TeadsApiRPC.prototype.hideVideoContainer=function(){return this.sendMessage({method:"hideVideoContainer",methodArgs:[]})},TeadsApiRPC.prototype.setSoundControlVisibility=function(visible){return this.sendMessage({method:"setSoundControlVisibility",methodArgs:[visible]})},TeadsApiRPC.prototype.setFullscreenButtonVisibility=function(visible){return this.sendMessage({method:"setFullscreenButtonVisibility",methodArgs:[visible]})},TeadsApiRPC.prototype.setProgressControlVisibility=function(visible){return this.sendMessage({method:"setProgressControlVisibility",methodArgs:[visible]})},TeadsApiRPC.prototype.setStartScreenVisibility=function(visible){return this.sendMessage({method:"setStartScreenVisibility",methodArgs:[visible]})},TeadsApiRPC.prototype.getSlotBounds=function(){return this.sendMessage({method:"getSlotBounds",methodArgs:[]})},TeadsApiRPC.prototype.sendVideoMetadata=function(metadata){return this.sendMessage({method:"sendVideoMetadata",methodArgs:[metadata]})},TeadsApiRPC.prototype.getSumologicOption=function(){return this.sendMessage({method:"getSumologicOption",methodArgs:[]})},TeadsApiRPC.prototype.getUserLocation=function(successHandler,errorHandler){return this.sendMessage({method:"getUserLocation",methodArgs:[]})},TeadsApiRPC.prototype.getTeadsInfo=function(){return this.sendMessage({method:"getTeadsInfo",methodArgs:[]})},TeadsApiRPC.prototype.addDeviceOrientationListener=function(){return this.keepListening=!0,this.sendMessage({method:"addDeviceOrientationListener",methodArgs:[]})},TeadsApiRPC.prototype.sendAdClickThru=function(params){return this.sendMessage({method:"sendAdClickThru",methodArgs:[params]})},TeadsApiRPC.prototype.requestInterscroller=function(){return this.sendMessage({method:"requestInterscroller",methodArgs:[]})},TeadsApiRPC.prototype.isMobile=function(){return this.sendMessage({method:"isMobile",methodArgs:[]})},TeadsApiRPC.prototype.callPlayerApiMethod=function(methodName,params){return this.sendMessage({method:methodName,methodArgs:params=void 0===params?[]:params})},TeadsApiRPC}()}(bnt=bnt||{}),function(bnt){var Creative=function(){function Creative(config){void 0===config&&(config={});var _this=this;this.screens=[],this.canvases=[],this.segments=[],this.screensToPreload=new bnt.Map(new bnt.ScreenHash),this.skippable=new bnt.ObservableValue,this.onElementAdded=new bnt.Observable,this.processingElementNames=new bnt.Set(new bnt.StringHash),this.onclick=new bnt.Observable,this.onmouseenter=new bnt.Observable,this.onmouseleave=new bnt.Observable,this.onmainscreen=new bnt.ObservableValue(!0),this.onscreenchange=new bnt.Observable,this.onload=new bnt.Observable,bnt.WithTimeline.call(this),Creative_1.instance=this,bnt.set(Creative_1,this),this.config=new bnt.CreativeConfig(config),this.skippable.update(!1),this.code=new bnt.Code,this.onload.addObserver(function(){return bnt.set(bnt.TeadsPlayerAddons,new bnt.TeadsPlayerAddons(_this))})}var Creative_1=Creative;return Object.defineProperty(Creative.prototype,"elements",{get:function(){var ret=new bnt.Map(new bnt.StringHash),getElementsInContainer=function(container){container.forEachEos(function(eos){ret.put(eos.element.elementId,eos.element),eos.element instanceof bnt.Group&&getElementsInContainer(eos.element)})};return this.forEachScreen(function(screen){return getElementsInContainer(screen)}),this.bannerScreen&&getElementsInContainer(this.bannerScreen),ret},enumerable:!1,configurable:!0}),Creative.prototype.addCanvas=function(canvas){this.canvases.push(canvas)},Creative.prototype.addSegment=function(segment){this.segments.push(segment)},Creative.prototype.cloneScreen=function(screen){return screen.clone()},Creative.prototype.getScreen=function(name){var theScreen=null;return this.screens.forEach(function(screen){screen.name==name&&(theScreen=screen)}),theScreen=this.bannerScreen&&this.bannerScreen.name==name?this.bannerScreen:theScreen},Creative.prototype.hasScreen=function(){return 0<this.screens.length},Creative.prototype.firstScreen=function(){if(this.screens.length)return this.screens[0];throw new Error("no screens defined")},Creative.prototype.forEachScreen=function(fn){this.screens.forEach(fn)},Creative.prototype.getCanvases=function(){return this.canvases.length||(this.config,this.canvases.push(new bnt.Canvas(new bnt.CanvasConfig({width:320,height:480})))),this.canvases},Creative.prototype.addScreen=function(screen){var _this=this;return this.validateScreenName(screen),screen.eos.reverse(),screen.eos.forEach(function(eos){var fn=function(el){var oldId=el.elementId;_this.validateElementName(el),oldId!==el.elementId&&screen.updateElementIdInAnimations(oldId,el.elementId),el instanceof bnt.Group&&el.eos.map(function(e){return fn(e.element)})};fn(eos.element)}),screen.eos.reverse(),this.screens.push(screen),this.clearProcessingElementNames(),screen},Creative.prototype.addElementOnScreen=function(container,eos){var _this=this,fn=function(el){_this.validateElementName(el),el instanceof bnt.Group&&el.eos.map(function(e){return fn(e.element)})};return fn(eos.element),this.clearProcessingElementNames(),bnt.get(Creative_1).onElementAdded.update(eos.element),container.addElementOnScreen(eos)},Creative.prototype.canRemoveScreen=function(screen){return-1!=this.screens.indexOf(screen)&&1<this.screens.length},Creative.prototype.removeScreen=function(screen){if(!this.canRemoveScreen(screen))throw new Error("Cant remove screen");this.screens.splice(this.screens.indexOf(screen),1),this.removeScreenFromInteractions(screen)},Creative.prototype.removeScreenFromInteractions=function(screenToRemove){function checkInteraction(interaction){interaction.actionParameters[0]==screenToRemove&&(interaction.actionParameters=[])}this.screens.forEach(function(screen){screen.interactions.forEach(checkInteraction),screen.eos.forEach(function(eos){eos.interactions.forEach(checkInteraction)})})},Creative.prototype.canRemoveCanvas=function(){return 1<this.canvases.length},Creative.prototype.removeCanvas=function(idx){!this.canRemoveCanvas()||-1!=(idx=this.canvases.indexOf(idx))&&this.canvases.splice(idx,1)},Creative.prototype.canRemoveSegment=function(){return 1<this.segments.length},Creative.prototype.removeSegment=function(idx){!this.canRemoveSegment()||-1!=(idx=this.segments.indexOf(idx))&&this.segments.splice(idx,1)},Creative.prototype.removeElement=function(element,screen){screen.removeElement(element),this.removeIfUnreferenced(element),this.removeElementFromInteractions(element)},Creative.prototype.removeIfUnreferenced=function(element){var count=0;this.screens.forEach(function(screen){count+=screen.countRefs(element)}),0==count&&this.elements.remove(element.elementId)},Creative.prototype.removeElementFromInteractions=function(elementToRemove){function checkInteraction(interaction){interaction.target==elementToRemove&&(interaction.target=null)}this.screens.forEach(function(screen){screen.interactions.forEach(checkInteraction),screen.eos.forEach(function(eos){eos.interactions.forEach(checkInteraction)})})},Creative.prototype.isNewScreenNameUnique=function(foundScreen,screen){if(this.elements.contains(foundScreen))return!1;foundScreen=this.getScreen(foundScreen);return!foundScreen||foundScreen==screen},Creative.prototype.isNewElementNameUnique=function(newName,element){return!this.getScreen(newName)&&(!this.elements.contains(newName)||this.elements.get(newName)==element)},Creative.prototype.isNameUnique=function(name){return!(this.getScreen(name)||this.elements.contains(name)||this.processingElementNames.contains(name))},Creative.prototype.validateElementName=function(element){element.elementId?this.isNameUnique(element.elementId)||(element.elementId=this.copiedElementId(element.elementId)):element.elementId=this.nextElementName(element.constructor),this.processingElementNames.add(element.elementId),this.elements.contains(element.elementId)||this.elements.put(element.elementId,element)},Creative.prototype.clearProcessingElementNames=function(){this.processingElementNames.clear()},Creative.prototype.validateScreenName=function(screen){screen.name&&this.isNameUnique(screen.name)||(screen.name=this.nextScreenName())},Creative.prototype.nextScreenName=function(){var screenNames={};this.screens.forEach(function(screen){if(!screen.name)throw new Error("Screen with no name found.")}),this.screens.forEach(function(screen){return screenNames[screen.name]=!0});for(var candidateNumber=Math.max(this.screens.length,1);screenNames["Screen"+candidateNumber.toString()];)candidateNumber++;return"Screen"+candidateNumber.toString()},Creative.prototype.nextElementName=function(type){var prefix=bnt.fnName(type);if(!prefix)throw new Error("Name not found for "+type);for(var candidate=1;!this.isNameUnique(prefix+candidate.toString());)candidate++;return prefix+candidate},Creative.prototype.copiedElementId=function(originalElementId){var takenNames=new jsSet(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],__read(this.screens.map(function(s){return s.name})),!1),__read(this.bannerScreen?[this.bannerScreen.name]:[]),!1),__read(this.elements.mapToArray(function(k){return k})),!1),__read(this.processingElementNames.toArray()),!1));return bnt.namingUtils.getCopyName(originalElementId,takenNames)},Creative.prototype.setController=function(controller){this.controller=controller,this.onload.update(void 0)},Creative.prototype.getController=function(){return this.controller},Creative.prototype.hintScreenPreload=function(screenIndex,screensToPreload){this.screensToPreload.put(screenIndex,screensToPreload)},__decorate([bnt.Transient,__metadata("design:type",bnt.Map),__metadata("design:paramtypes",[])],Creative.prototype,"elements",null),__decorate([bnt.Transient,__metadata("design:type",bnt.AdController)],Creative.prototype,"controller",void 0),__decorate([bnt.Transient,__metadata("design:type",bnt.CreativeTimeline)],Creative.prototype,"timeline",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Creative.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Creative.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Creative.prototype,"onmouseleave",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Creative.prototype,"onplay",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Creative.prototype,"onend",void 0),Creative_1=__decorate([bnt.Mixin(bnt.WithTimeline),bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Creative)}();bnt.Creative=Creative}(bnt=bnt||{}),function(bnt){var Element=function(_super){function ElementHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ElementHash,_super),ElementHash.prototype.hash=function(canvas){return canvas.elementId},__decorate([bnt.Serializable({})],ElementHash)}(bnt.HashFn);bnt.ElementHash=Element;Element=function(){function Element(baseConfig){var _this=this;this.visible=new bnt.ObservableValue,this.onrender=new bnt.ObservableValue,this.configs=new bnt.Map(new bnt.StateHash),this.baseConfig={},this.show=function(){_this.forceVisible(!0)},this.hide=function(){_this.forceVisible(!1)},this.id=bnt.IdClass.getNext(),this.baseConfig=baseConfig}return Element.prototype.setConfig=function(state,config){this.configs.put(state,config)},Element.prototype.getConfig=function(state){if(state)return this.hasConfig(state)||this.initConfig(state),this.configs.get(state)},Element.prototype.hasConfig=function(state){return this.configs.contains(state)},Element.prototype.initConfig=function(state){this.configs.put(state,this.getBaseConfigCopy())},Element.prototype.getConfigCopy=function(config){if(this.hasConfig(config)){config=this.getConfig(config);return new config.constructor(config)}return this.getBaseConfigCopy()},Element.prototype.removeConfig=function(state){this.configs.remove(state)},Element.prototype.getConfigsCopy=function(){return this.configs.mapKeys(function(state,config){return new config.constructor(config)})},Element.prototype.setBaseConfig=function(config){this.baseConfig=config},Element.prototype.getBaseConfigCopy=function(){var one=this.configs.one();return one?new one.constructor(one):new this.baseConfig.constructor(this.baseConfig)},Object.defineProperty(Element.prototype,"htmlElement",{get:function(){return bnt.ElementRendererRegistry.rendererFor(this).htmlElement},enumerable:!1,configurable:!0}),Element.prototype.clone=function(){var clonedElement=new this.constructor(this.getBaseConfigCopy());return clonedElement.elementId=this.elementId,this.getConfigsCopy().forEach(function(state,config){clonedElement.setConfig(state,config)}),clonedElement},Element.prototype.forceVisible=function(visible){this.overrideConfig({visible:visible}),this.visible.update(visible)},Element.prototype.overrideConfig=function(configDiff){this.configs.forEach(function(state,config){Object.keys(configDiff).forEach(function(key){config[key]=configDiff[key]})})},Element.prototype.update=function(configDiff){this.overrideConfig(configDiff),this.refresh()},Element.prototype.refresh=function(){bnt.ElementRendererRegistry.rendererFor(this).configure(bnt.get(bnt.State))},Element.ERR_MISSING_STATE="Missing state!",__decorate([bnt.Transient,__metadata("design:type",String)],Element.prototype,"id",void 0),Element}();bnt.Element=Element}(bnt=bnt||{}),function(bnt){var WithInteraction=function(){function WithInteraction(){this.interactions=new Array}return WithInteraction.prototype.removeInteraction=function(idx){idx=this.interactions.indexOf(idx);-1!=idx&&this.interactions.splice(idx,1)},WithInteraction}();bnt.WithInteraction=WithInteraction}(bnt=bnt||{}),function(bnt){var ElementOnScreen=function(_super){function ElementOnScreenHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ElementOnScreenHash,_super),ElementOnScreenHash.prototype.hash=function(eos){return eos.id},__decorate([bnt.Serializable({})],ElementOnScreenHash)}(bnt.HashFn);bnt.ElementOnScreenHash=ElementOnScreen;ElementOnScreen=function(){function ElementOnScreen(element){this.element=element,this.configs=new bnt.Map(new bnt.StateHash),this.baseConfig={},bnt.WithInteraction.call(this),this.id=bnt.IdClass.getNext()}var ElementOnScreen_1=ElementOnScreen;return ElementOnScreen.prototype.setConfig=function(state,config){this.configs.put(state,config)},ElementOnScreen.prototype.getConfig=function(state){if(state)return this.hasConfig(state)||this.initConfig(state),this.configs.get(state)},ElementOnScreen.prototype.hasConfig=function(state){return this.configs.contains(state)},ElementOnScreen.prototype.initConfig=function(state){this.configs.put(state,this.getBaseConfigCopy())},ElementOnScreen.prototype.getConfigCopy=function(config){if(this.hasConfig(config)){config=this.getConfig(config);return new config.constructor(config)}return this.getBaseConfigCopy()},ElementOnScreen.prototype.removeConfig=function(state){this.configs.remove(state)},ElementOnScreen.prototype.getBaseConfigCopy=function(){var one=this.configs.one();return one?new bnt.ElementOnScreenConfig(one):new bnt.ElementOnScreenConfig(this.baseConfig)},ElementOnScreen.prototype.getConfigsCopy=function(){return this.configs.mapKeys(function(state,config){return new bnt.ElementOnScreenConfig(config)})},ElementOnScreen.prototype.getInteractionsCopy=function(){var copies=[];return this.interactions.forEach(function(interaction){copies.push(interaction.clone())}),copies},ElementOnScreen.prototype.setBaseConfig=function(config){this.baseConfig=config},ElementOnScreen.prototype.initZIndex=function(value){this.configs.forEach(function(canvas,eosConfig){return eosConfig.zIndex=value})},ElementOnScreen.prototype.cleanupInteractions=function(){this.interactions.forEach(function(interaction){interaction.target=null})},ElementOnScreen.prototype.clone=function(){var eos=new ElementOnScreen_1(this.element.clone());return eos.configs=this.getConfigsCopy(),eos.baseConfig=this.getBaseConfigCopy(),eos.interactions=this.getInteractionsCopy(),eos},__decorate([bnt.Transient,__metadata("design:type",String)],ElementOnScreen.prototype,"id",void 0),ElementOnScreen_1=__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.WithInteraction),__metadata("design:paramtypes",[bnt.Element])],ElementOnScreen)}();bnt.ElementOnScreen=ElementOnScreen}(bnt=bnt||{}),function(bnt){var Interaction=function(){function Interaction(){this.triggerName="",this.triggerFilter="",this.fireOnce=!1,this.triggerOnce=!1,this._actionParameters=[],this.transition={name:"",in:"",out:""}}var Interaction_1=Interaction;return Object.defineProperty(Interaction.prototype,"action",{get:function(){return this._action},set:function(value){this._action=value="destroy"==value?"closeAd":value},enumerable:!1,configurable:!0}),Object.defineProperty(Interaction.prototype,"target",{get:function(){return this.targetName&&(this._target=bnt.Creative.instance.elements.get(this.targetName),delete this.targetName),this._target},set:function(e){this._target=e},enumerable:!1,configurable:!0}),Object.defineProperty(Interaction.prototype,"actionParameters",{get:function(){return"switchTo"==this.action&&"string"==typeof this._actionParameters[0]&&(this._actionParameters[0]=bnt.Creative.instance.getScreen(this._actionParameters[0])),this._actionParameters},set:function(p){this._actionParameters=p},enumerable:!1,configurable:!0}),Interaction.prototype.clone=function(){var clone=new Interaction_1;return clone.triggerName=this.triggerName,clone.triggerFilter=this.triggerFilter,clone.fireOnce=this.fireOnce,clone.triggerOnce=this.triggerOnce,clone._action=this._action,clone.targetName=this.targetName,clone._target=this._target,clone._actionParameters=this._actionParameters.slice(0),clone.transition={name:this.transition.name,in:this.transition.in,out:this.transition.out,duration:this.transition.duration},clone},Interaction_1=__decorate([bnt.Serializable({})],Interaction)}();bnt.Interaction=Interaction}(bnt=bnt||{}),function(bnt){var MoveDirection;!function(MoveDirection){MoveDirection[MoveDirection.Bottom=0]="Bottom",MoveDirection[MoveDirection.Top=1]="Top",MoveDirection[MoveDirection.Up=2]="Up",MoveDirection[MoveDirection.Down=3]="Down"}(MoveDirection=bnt.MoveDirection||(bnt.MoveDirection={})),bnt.moveItemInArray=function(array,item,direction){var idx=array.indexOf(item);if(-1!==idx)switch(array.splice(idx,1),direction){case MoveDirection.Up:array.splice(Math.max(0,idx-1),0,item);break;case MoveDirection.Down:array.splice(Math.min(array.length,idx+1),0,item);break;case MoveDirection.Top:array.unshift(item);break;case MoveDirection.Bottom:array.push(item)}},bnt.arrayIncludes=function(array,item){return-1!==array.indexOf(item)}}(bnt=bnt||{});var bnt,DEFAULT_SCENE_NAME_PREFIX="Scene";function getWindowExtended(){return window}!function(bnt){var Screen=function(_super){function ScreenHash(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ScreenHash,_super),ScreenHash.prototype.hash=function(screen){return screen.name},__decorate([bnt.Serializable({})],ScreenHash)}(bnt.HashFn);bnt.ScreenHash=Screen;Screen=function(){function Screen(config){void 0===config&&(config={}),this.id=bnt.IdClass.getNext(),this.customLoads=[],this.eos=[],this.indexMapping=new bnt.Map(new bnt.ElementHash),this.scenes=new bnt.Map(new bnt.StateHash),this.onclick=new bnt.Observable,this.onshow=new bnt.Observable,this.onhide=new bnt.Observable,this.onshowAnimationStart=new bnt.Observable,this.onshowAnimationEnd=new bnt.Observable,this.onhideAnimationStart=new bnt.Observable,this.onhideAnimationEnd=new bnt.Observable,this.onswipeleft=new bnt.Observable,this.onswiperight=new bnt.Observable,this.onswipeup=new bnt.Observable,this.onswipedown=new bnt.Observable,this.remainingTime=new bnt.ObservableValue,this.time=new bnt.ObservableValue,this.onscrollDown=new bnt.ObservableValue,this.onscrollUp=new bnt.ObservableValue,bnt.WithInteraction.call(this),bnt.WithTimeline.call(this),this.config=new bnt.ScreenConfig(config)}var Screen_1=Screen;return Screen.prototype.getScenes=function(state){return Object.values(this.getScenesById(state))},Screen.prototype.getScenesById=function(state){return state&&this.scenes.contains(state)?structuredClone(this.scenes.get(state)):{}},Screen.prototype.applySceneUpdates=function(state,sceneId,updatedScene,validateOnly){void 0===validateOnly&&(validateOnly=!1);var _a=this.getScenesById(state);if(!(sceneId in _a))throw new Error('Scene with id "'.concat(sceneId,'" does not exist.'));updatedScene=bnt.applySceneUpdates(_a[sceneId],updatedScene);return this.validateUniqueSceneName(Object.values(_a),updatedScene),this.validateSceneDuration(updatedScene),this.validateSceneRepeatTimes(updatedScene),validateOnly||this.setScenesById(state,__assign(__assign({},_a),((_a={})[sceneId]=updatedScene,_a))),updatedScene},Screen.prototype.createScene=function(_a,scene){void 0===scene&&(scene=!1);var baseSceneProps={name:this.getNextSceneName(_a),id:bnt.UUID.get(),elementAnimations:{}},scene=__assign(__assign({},baseSceneProps),scene?bnt.DEFAULT_SCROLL_DRIVEN_SCENE_CONFIG:bnt.DEFAULT_TIME_DRIVEN_SCENE_CONFIG);return this.setScenesById(_a,__assign(__assign({},this.getScenesById(_a)),((_a={})[scene.id]=scene,_a))),scene},Screen.prototype.duplicateScene=function(state,newScene){var _a=this.getScenesById(state);if(!(newScene in _a))throw new Error('Scene with id "'.concat(newScene,'" does not exist.'));var originalScene=_a[newScene],newScene=structuredClone(originalScene);return newScene.id=bnt.UUID.get(),newScene.name=this.getCopiedSceneName(state,originalScene.name),this.setScenesById(state,__assign(__assign({},_a),((_a={})[newScene.id]=newScene,_a))),newScene},Screen.prototype.removeScene=function(state,remainingScenes){var _a=this.getScenesById(state),remainingScenes=(_a[remainingScenes],__rest(_a,["symbol"==typeof remainingScenes?remainingScenes:remainingScenes+""]));this.setScenesById(state,remainingScenes)},Screen.prototype.reorderScenes=function(state,reorderedScenesById){var currentScenesById=this.getScenesById(state),currentIds=Object.keys(currentScenesById);if(!bnt.objectUtils.arraysContainSameElements(currentIds,reorderedScenesById))throw new Error("Scene IDs do not match.");reorderedScenesById=bnt.objectUtils.mapArray(reorderedScenesById,function(id){var _a={};return _a[id]=currentScenesById[id],_a});this.setScenesById(state,reorderedScenesById)},Screen.prototype.updateElementIdInAnimations=function(oldId,newId){var _this=this;this.scenes.forEach(function(state,scenesById){Object.entries(scenesById).forEach(function(sceneId){var updatedElementAnimations=__read(sceneId,2),sceneId=updatedElementAnimations[0],updatedElementAnimations=updatedElementAnimations[1];updatedElementAnimations.elementAnimations&&updatedElementAnimations.elementAnimations[oldId]&&((updatedElementAnimations=__assign({},updatedElementAnimations.elementAnimations))[newId]=updatedElementAnimations[oldId],delete updatedElementAnimations[oldId],_this.applySceneUpdates(state,sceneId,{elementAnimations:updatedElementAnimations},!1))})})},Screen.prototype.addElementOnScreen=function(eos){return this.eos.unshift(eos),bnt.get(bnt.Creative).onElementAdded.update(eos.element),eos},Screen.prototype.addElementOnScreenAtEnd=function(eos){return this.eos.push(eos),bnt.get(bnt.Creative).onElementAdded.update(eos.element),eos},Screen.prototype.getEosByElementId=function(elementId){var fn=function(container){var theEos=null;return container.forEachEos(function(res){res.element.elementId==elementId?theEos=res:res.element instanceof bnt.Group&&((res=fn(res.element))&&(theEos=res))}),theEos};return fn(this)},Screen.prototype.getEosByType=function(ctor){return this.eos.filter(function(eos){return eos.element.constructor==ctor})},Screen.prototype.deepGetEosByType=function(ctor){var fn=function(container){var arr=container.eos.filter(function(e){return e.element instanceof ctor});return container.eos.forEach(function(e){e.element instanceof bnt.Group&&(arr=__spreadArray(__spreadArray([],__read(arr),!1),__read(fn(e.element)),!1))}),arr};return fn(this)},Screen.prototype.getEos=function(element){var theEos=null;return this.eos.forEach(function(eos){eos.element==element&&(theEos=eos)}),theEos},Screen.prototype.deepGetEos=function(element){var theEos=null,fn=function(container){container.forEachEos(function(eos){eos.element==element&&(theEos=eos),eos.element instanceof bnt.Group&&fn(eos.element)})};return fn(this),theEos},Screen.prototype.getAllEos=function(){return this.eos.reduce(function(a,eos){return __spreadArray(__spreadArray([],__read(a),!1),__read(eos.element instanceof bnt.Group?__spreadArray([eos],__read(eos.element.getAllEos()),!1):[eos]),!1)},[])},Screen.prototype.forEachEos=function(fn){this.eos.forEach(fn)},Screen.prototype.eosMap=function(fn){return this.eos.map(fn)},Screen.prototype.eosFilter=function(fn){return this.eos.filter(fn)},Screen.prototype.moveEosUp=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Up)},Screen.prototype.moveEosToTop=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Top)},Screen.prototype.moveEosDown=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Down)},Screen.prototype.moveEosToBottom=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Bottom)},Screen.prototype.countRefs=function(element){return this.eos.filter(function(eos){return eos.element==element}).length},Screen.prototype.getEosIndex=function(element){var theIndex=null;return this.eos.forEach(function(eos,index){eos.element==element&&(theIndex=index)}),theIndex},Screen.prototype.executeScreenElementsMapping=function(container,lastIndex){var _this=this;return void 0===lastIndex&&(lastIndex=-1),container.eos.forEach(function(eos){_this.indexMapping.get(eos.element)||(lastIndex++,_this.indexMapping.put(eos.element,lastIndex),eos.element instanceof bnt.Group&&(lastIndex=_this.executeScreenElementsMapping(eos.element,lastIndex)))}),lastIndex},Screen.prototype.mapScreenElementsIndexes=function(){this.indexMapping=new bnt.Map(new bnt.ElementHash),this.executeScreenElementsMapping(this)},Screen.prototype.getBottomElementByType=function(ctor){for(var _this=this,typeElements=this.deepGetEosByType(ctor),unindexedElement=!1,i=0,len=typeElements.length;i<len;i++)this.indexMapping&&!this.indexMapping.get(typeElements[i].element)&&(unindexedElement=!0);return unindexedElement&&this.mapScreenElementsIndexes(),typeElements.length&&typeElements.sort(function(a,b){return _this.indexMapping.get(b.element)-_this.indexMapping.get(a.element)})[0].element},Screen.prototype.removeElement=function(element){var removeEosFromContainer=function(container){return container.eos.filter(function(e){return e.element!=element}).map(function(e){return e.element instanceof bnt.Group&&(e.element.eos=removeEosFromContainer(e.element)),e})};this.eos=removeEosFromContainer(this)},Screen.prototype.setConfig=function(element,state,config){this.getEos(element).setConfig(state,config)},Screen.prototype.getPath=function(theEos){var fn=function(container,containerEos){var e_12,_a;if(container){var isScreen=container instanceof bnt.Screen;try{for(var _b=__values(container.eos),_c=_b.next();!_c.done;_c=_b.next()){var eos=_c.value;if(eos==theEos)return isScreen?[]:[containerEos];if(eos.element instanceof bnt.Group){var path=fn(eos.element,eos);if(path&&path.length)return isScreen?path:__spreadArray([containerEos],__read(path),!1)}}}catch(e_12_1){e_12={error:e_12_1}}finally{try{_c&&!_c.done&&(_a=_b.return)&&_a.call(_b)}finally{if(e_12)throw e_12.error}}}};return fn(this)},Screen.prototype.addCustomLoad=function(future){this.customLoads.push(future)},Screen.prototype.clone=function(){var newScreen=new Screen_1(this.config);return newScreen.name=this.name,bnt.cloneContainerContents(this,newScreen),newScreen},Screen.prototype.setScenesById=function(state,scenes){this.ensureCorrectSceneIdKeys(scenes);var scenesList=Object.values(scenes);this.validateUniqueSceneNames(scenesList),this.scenes.put(state,structuredClone(scenes))},Screen.prototype.ensureCorrectSceneIdKeys=function(scenes){Object.entries(scenes).forEach(function(sceneId){var scene=__read(sceneId,2),sceneId=scene[0],scene=scene[1];scene.id!==sceneId&&(scene.id=sceneId)})},Screen.prototype.validateUniqueSceneNames=function(sceneNames){var e_13,_a,sceneNames=sceneNames.map(function(scene){return scene.name}),uniqueNames=[];try{for(var sceneNames_1=__values(sceneNames),sceneNames_1_1=sceneNames_1.next();!sceneNames_1_1.done;sceneNames_1_1=sceneNames_1.next()){var name_2=sceneNames_1_1.value;if(-1!==uniqueNames.indexOf(name_2))throw new bnt.ValidationErrors({name:'Scene name "'.concat(name_2,'" is not unique.')});uniqueNames.push(name_2)}}catch(e_13_1){e_13={error:e_13_1}}finally{try{sceneNames_1_1&&!sceneNames_1_1.done&&(_a=sceneNames_1.return)&&_a.call(sceneNames_1)}finally{if(e_13)throw e_13.error}}},Screen.prototype.validateUniqueSceneName=function(allScenes,scene){if(allScenes.some(function(s){return s.name===scene.name&&s.id!==scene.id}))throw new bnt.ValidationErrors({name:'Scene name "'.concat(scene.name,'" is not unique.')})},Screen.prototype.validateSceneDuration=function(scene){if(!scene.scrollDriven&&("number"!=typeof scene.duration||scene.duration<0))throw new bnt.ValidationErrors({duration:"Must be a non-negative number."})},Screen.prototype.validateSceneRepeatTimes=function(scene){if(!scene.scrollDriven&&"number"==typeof scene.repeatTimes&&scene.repeatTimes<0)throw new bnt.ValidationErrors({repeatTimes:"Must be a non-negative number."})},Screen.prototype.getNextSceneName=function(state){for(var usedDefaultSceneNames=new jsSet(this.getScenes(state).map(function(s){return s.name}).filter(function(name){return name.startsWith(DEFAULT_SCENE_NAME_PREFIX)})),nextSceneNumber=1;;nextSceneNumber++){var nextSceneName="".concat(DEFAULT_SCENE_NAME_PREFIX).concat(nextSceneNumber);if(!usedDefaultSceneNames.has(nextSceneName))return nextSceneName}},Screen.prototype.getCopiedSceneName=function(takenNames,originalName){takenNames=new jsSet(this.getScenes(takenNames).map(function(s){return s.name}));return bnt.namingUtils.getCopyName(originalName,takenNames)},__decorate([bnt.Transient,__metadata("design:type",Object)],Screen.prototype,"id",void 0),__decorate([bnt.Transient,__metadata("design:type",bnt.ScreenTimeline)],Screen.prototype,"timeline",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Screen.prototype,"onend",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Screen.prototype,"onshow",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Screen.prototype,"onhide",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Screen.prototype,"onswipeleft",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Screen.prototype,"onswiperight",void 0),__decorate([bnt.Event("number"),__metadata("design:type",Object)],Screen.prototype,"remainingTime",void 0),__decorate([bnt.Event("number"),__metadata("design:type",Object)],Screen.prototype,"time",void 0),__decorate([bnt.Event("number"),__metadata("design:type",Object)],Screen.prototype,"onscrollDown",void 0),__decorate([bnt.Event("number"),__metadata("design:type",Object)],Screen.prototype,"onscrollUp",void 0),Screen_1=__decorate([bnt.Mixin(bnt.WithTimeline,bnt.WithInteraction),bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Screen)}();bnt.Screen=Screen}(bnt=bnt||{}),function(bnt){var Video=function(_super){function Video(_this){_this=_super.call(this,new bnt.VideoConfig(_this=void 0===_this?{}:_this))||this;return _this.onclick=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this.remainingTime=new bnt.ObservableValue,_this.time=new bnt.ObservableValue,_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,bnt.WithTimeline.call(_this),_this}return __extends(Video,_super),__decorate([bnt.Transient,__metadata("design:type",String)],Video.prototype,"id",void 0),__decorate([bnt.Transient,__metadata("design:type",bnt.VideoTimeline)],Video.prototype,"timeline",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onmouseleave",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Video.prototype,"onplay",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Video.prototype,"onpause",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Video.prototype,"onend",void 0),__decorate([bnt.Event(),__metadata("design:type",bnt.Observable)],Video.prototype,"onstop",void 0),__decorate([bnt.Event("number"),__metadata("design:type",Object)],Video.prototype,"remainingTime",void 0),__decorate([bnt.Event("number"),__metadata("design:type",Object)],Video.prototype,"time",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Video.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Video.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Video.prototype,"hide",void 0),__decorate([bnt.Mixin(bnt.WithTimeline),bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Video)}(bnt.Element);bnt.Video=Video}(bnt=bnt||{}),function(bnt){var Image=function(_super){function Image(_this){_this=_super.call(this,new bnt.ImageConfig(_this=void 0===_this?{}:_this))||this;return _this.onclick=new bnt.Observable,_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(Image,_super),__decorate([bnt.Transient,__metadata("design:type",String)],Image.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Image.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Image.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Image.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Image)}(bnt.Element);bnt.Image=Image}(bnt=bnt||{}),function(bnt){var CloseButton=function(_super){function CloseButton(_this){_this=_super.call(this,new bnt.CloseButtonConfig(_this=void 0===_this?{}:_this))||this;return _this.onclick=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(CloseButton,_super),__decorate([bnt.Event(),__metadata("design:type",Object)],CloseButton.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],CloseButton.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],CloseButton.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],CloseButton.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],CloseButton.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],CloseButton)}(bnt.Element);bnt.CloseButton=CloseButton}(bnt=bnt||{}),function(bnt){var OverlayScreen=function(_super){function OverlayScreen(closeButtonEos){var _this=_super.call(this,closeButtonEos=void 0===closeButtonEos?{}:closeButtonEos)||this;_this.onclick=new bnt.Observable,_this.closeButton=new bnt.CloseButton(closeButtonEos.closeButton);closeButtonEos=new bnt.ElementOnScreen(_this.closeButton);return _this.addElementOnScreen(closeButtonEos),_this}return __extends(OverlayScreen,_super),__decorate([bnt.Event(),__metadata("design:type",Object)],OverlayScreen.prototype,"onclick",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],OverlayScreen)}(bnt.Screen);bnt.OverlayScreen=OverlayScreen}(bnt=bnt||{}),function(bnt){var TextBox=function(_super){function TextBox(_this){_this=_super.call(this,new bnt.TextBoxConfig(_this=void 0===_this?{}:_this))||this;return _this.onclick=new bnt.Observable,_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(TextBox,_super),Object.defineProperty(TextBox.prototype,"text",{get:function(){return this.getConfig(bnt.get(bnt.State)).text},set:function(value){this.getConfig(bnt.get(bnt.State)).text=value,this.refresh()},enumerable:!1,configurable:!0}),__decorate([bnt.Transient,__metadata("design:type",String)],TextBox.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],TextBox.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],TextBox.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],TextBox.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],TextBox)}(bnt.Element);bnt.TextBox=TextBox}(bnt=bnt||{}),function(bnt){var HtmlBox=function(_super){function HtmlBox(_this){_this=_super.call(this,new bnt.HtmlBoxConfig(_this=void 0===_this?{}:_this))||this;return _this.htmlCode="",_this.onclick=new bnt.Observable,_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(HtmlBox,_super),HtmlBox.prototype.clone=function(){var element=_super.prototype.clone.call(this);return element.htmlCode=this.htmlCode,element},__decorate([bnt.Transient,__metadata("design:type",String)],HtmlBox.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],HtmlBox.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],HtmlBox.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],HtmlBox.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],HtmlBox)}(bnt.Element);bnt.HtmlBox=HtmlBox}(bnt=bnt||{}),function(bnt){var Shape=function(_super){function Shape(_this){_this=_super.call(this,new bnt.ShapeConfig(_this=void 0===_this?{}:_this))||this;return _this.onclick=new bnt.Observable,_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(Shape,_super),__decorate([bnt.Transient,__metadata("design:type",String)],Shape.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Shape.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Shape.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Shape.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Shape)}(bnt.Element);bnt.Shape=Shape}(bnt=bnt||{}),function(bnt){var Hotspot=function(_super){function Hotspot(_this){_this=_super.call(this,new bnt.HotspotConfig(_this=void 0===_this?{}:_this))||this;return _this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onclick=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(Hotspot,_super),__decorate([bnt.Transient,__metadata("design:type",String)],Hotspot.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Hotspot.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Hotspot.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Hotspot.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Hotspot)}(bnt.Element);bnt.Hotspot=Hotspot}(bnt=bnt||{}),function(bnt){var Subtitle=function(_super){function Subtitle(_this){_this=_super.call(this,new bnt.SubtitleConfig(_this=void 0===_this?{}:_this))||this;return _this.onclick=new bnt.Observable,_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}return __extends(Subtitle,_super),__decorate([bnt.Transient,__metadata("design:type",String)],Subtitle.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Subtitle.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Subtitle.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Subtitle.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Subtitle.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Subtitle.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Subtitle.prototype,"hide",void 0),__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Subtitle)}(bnt.Element);bnt.Subtitle=Subtitle}(bnt=bnt||{}),function(bnt){var Group=function(_super){function Group(_this){_this=_super.call(this,new bnt.GroupConfig(_this=void 0===_this?{}:_this))||this;return _this.eos=[],_this.onshowAnimationStart=new bnt.Observable,_this.onshowAnimationEnd=new bnt.Observable,_this.onhideAnimationStart=new bnt.Observable,_this.onhideAnimationEnd=new bnt.Observable,_this.onclick=new bnt.Observable,_this.onmouseenter=new bnt.Observable,_this.onmouseleave=new bnt.Observable,_this}var Group_1;return __extends(Group,_super),(Group_1=Group).prototype.addElementOnScreen=function(eos){return this.eos.unshift(eos),bnt.get(bnt.Creative).onElementAdded.update(eos.element),eos},Group.prototype.addElementOnScreenAtEnd=function(eos){return this.eos.push(eos),bnt.get(bnt.Creative).onElementAdded.update(eos.element),eos},Group.prototype.getEosByElementId=function(elementId){var theEos=null;return this.forEachEos(function(eos){eos.element.elementId==elementId&&(theEos=eos)}),theEos},Group.prototype.getEosByType=function(ctor){return this.eos.filter(function(eos){return eos.element.constructor==ctor})},Group.prototype.deepGetEosByType=function(ctor){var fn=function(container){var arr=container.eos.filter(function(e){return e.element instanceof ctor});return container.eos.forEach(function(e){e.element instanceof bnt.Group&&(arr=__spreadArray(__spreadArray([],__read(arr),!1),__read(fn(e.element)),!1))}),arr};return fn(this)},Group.prototype.getEos=function(element){var theEos=null;return this.eos.forEach(function(eos){eos.element==element&&(theEos=eos)}),theEos},Group.prototype.getAllEos=function(){return this.eos.reduce(function(a,eos){return __spreadArray(__spreadArray([],__read(a),!1),__read(eos.element instanceof bnt.Group?__spreadArray([eos],__read(eos.element.getAllEos()),!1):[eos]),!1)},[])},Group.prototype.forEachEos=function(fn){this.eos.forEach(fn)},Group.prototype.eosMap=function(fn){return this.eos.map(fn)},Group.prototype.eosFilter=function(fn){return this.eos.filter(fn)},Group.prototype.moveEosUp=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Up)},Group.prototype.moveEosToTop=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Top)},Group.prototype.moveEosDown=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Down)},Group.prototype.moveEosToBottom=function(eos){bnt.moveItemInArray(this.eos,eos,bnt.MoveDirection.Bottom)},Group.prototype.getEosIndex=function(element){var theIndex=null;return this.eos.forEach(function(eos,index){eos.element==element&&(theIndex=index)}),theIndex},Group.prototype.removeElement=function(element){this.eos.splice(this.getEosIndex(element),1)},Group.prototype.clone=function(){var baseConfig=this.getBaseConfigCopy(),newGroup=new Group_1(baseConfig);return newGroup.elementId=this.elementId,newGroup.setBaseConfig(baseConfig),this.getConfigsCopy().forEach(function(state,config){newGroup.setConfig(state,new bnt.GroupConfig(config))}),bnt.cloneContainerContents(this,newGroup),newGroup},__decorate([bnt.Transient,__metadata("design:type",String)],Group.prototype,"id",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onshowAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onshowAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onhideAnimationStart",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onhideAnimationEnd",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onclick",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onmouseenter",void 0),__decorate([bnt.Event(),__metadata("design:type",Object)],Group.prototype,"onmouseleave",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Group.prototype,"show",void 0),__decorate([bnt.Action(),__metadata("design:type",Function)],Group.prototype,"hide",void 0),Group_1=__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],Group)}(bnt.Element);bnt.Group=Group}(bnt=bnt||{}),function(bnt){var VideoConfig=function(){function VideoConfig(config){this.autoplay=bnt.withDefault((config=void 0===config?{}:config).autoplay,bnt.Defaults.video.autoplay),this.mute=bnt.withDefault(config.mute,bnt.Defaults.video.mute),this.videoWidth=bnt.withDefault(config.videoWidth,bnt.Defaults.video.videoWidth),this.videoHeight=bnt.withDefault(config.videoHeight,bnt.Defaults.video.videoHeight),this.videoDuration=bnt.withDefault(config.videoDuration,bnt.Defaults.video.videoDuration),this.coverWidth=bnt.withDefault(config.coverWidth,bnt.Defaults.video.coverWidth),this.coverHeight=bnt.withDefault(config.coverHeight,bnt.Defaults.video.coverHeight),this.soundIconConfigured=bnt.withDefault(config.soundIconConfigured,bnt.Defaults.video.soundIconConfigured),this.soundIconVisible=bnt.withDefault(config.soundIconVisible,bnt.Defaults.video.soundIconVisible),this.soundIconColor=bnt.withDefault(config.soundIconColor,bnt.Defaults.video.soundIconColor),this.soundIconSize=bnt.withDefault(config.soundIconSize,bnt.Defaults.video.soundIconSize),this.soundIconBackgroundColor=bnt.withDefault(config.soundIconBackgroundColor,bnt.Defaults.video.soundIconBackgroundColor),this.soundIconBackgroundSize=bnt.withDefault(config.soundIconBackgroundSize,bnt.Defaults.video.soundIconBackgroundSize),this.soundIconX=bnt.withDefault(config.soundIconX,bnt.Defaults.video.soundIconX),this.soundIconY=bnt.withDefault(config.soundIconY,bnt.Defaults.video.soundIconY),this.soundIconHiddenScreens=bnt.withDefault(config.soundIconHiddenScreens,bnt.Defaults.video.soundIconHiddenScreens),this.configureSrc(config,bnt.Defaults.video),this.configureDimension(config,bnt.Defaults.video),this.configureVisibility(config,bnt.Defaults.video),this.configureOpacity(config,bnt.Defaults.video),this.configureCover(config,bnt.Defaults.video),this.configurePan(config,bnt.Defaults.video),this.configureAngle(config,bnt.Defaults.video)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.SrcConfig,bnt.DimensionConfig,bnt.VisibilityConfig,bnt.OpacityConfig,bnt.CoverConfig,bnt.PanConfig,bnt.RotationConfig),__metadata("design:paramtypes",[Object])],VideoConfig)}();bnt.VideoConfig=VideoConfig}(bnt=bnt||{}),function(bnt){var ImageConfig=function(){function ImageConfig(config){this.imageWidth=bnt.withDefault((config=void 0===config?{}:config).imageWidth,bnt.Defaults.image.imageWidth),this.imageHeight=bnt.withDefault(config.imageHeight,bnt.Defaults.image.imageHeight),this.configureHoverImage(config,bnt.Defaults.image),this.configureSrc(config,bnt.Defaults.image),this.configureDimension(config,bnt.Defaults.image),this.configureAngle(config,bnt.Defaults.image),this.configureVisibility(config,bnt.Defaults.image),this.configureOpacity(config,bnt.Defaults.image),this.configurePan(config,bnt.Defaults.image)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.SrcConfig,bnt.DimensionConfig,bnt.RotationConfig,bnt.VisibilityConfig,bnt.OpacityConfig,bnt.PanConfig,bnt.HoverImageConfig),__metadata("design:paramtypes",[Object])],ImageConfig)}();bnt.ImageConfig=ImageConfig}(bnt=bnt||{}),function(bnt){var PositionConfig=function(){function PositionConfig(){}return PositionConfig.prototype.configurePosition=function(config,defaults){this.x=bnt.withDefault(config.x,defaults.x),this.y=bnt.withDefault(config.y,defaults.y)},__decorate([bnt.Serializable({})],PositionConfig)}();bnt.PositionConfig=PositionConfig}(bnt=bnt||{}),function(bnt){var AnimationConfig=function(){function AnimationConfig(config){(config=void 0===config?{}:config)?(this.name=bnt.withDefault(config.name,bnt.Defaults.animation.name),this.delay=bnt.withDefault(config.delay,bnt.Defaults.animation.delay),this.duration=bnt.withDefault(config.duration,bnt.Defaults.animation.duration),this.ease=bnt.withDefault(config.ease,bnt.Defaults.animation.ease),this.repeat=bnt.withDefault(config.repeat,bnt.Defaults.animation.repeat)):(this.name=bnt.Defaults.animation.name,this.delay=bnt.Defaults.animation.delay,this.duration=bnt.Defaults.animation.duration,this.ease=bnt.Defaults.animation.ease,this.repeat=bnt.Defaults.animation.repeat)}return Object.defineProperty(AnimationConfig.prototype,"duration",{get:function(){return this._duration},set:function(value){this._duration=value=value||0},enumerable:!1,configurable:!0}),__decorate([bnt.Serializable({}),__metadata("design:paramtypes",[Object])],AnimationConfig)}();bnt.AnimationConfig=AnimationConfig}(bnt=bnt||{}),function(bnt){var ElementOnScreenConfig=function(){function ElementOnScreenConfig(config){this.zIndex=bnt.withDefault((config=void 0===config?{}:config).zIndex,bnt.Defaults.elementOnScreen.zIndex),this.configurePosition(config,bnt.Defaults.elementOnScreen),this.configureOnHide(config.onHide),this.configureOnShow(config.onShow)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.PositionConfig,bnt.TransitionConfig),__metadata("design:paramtypes",[Object])],ElementOnScreenConfig)}();bnt.ElementOnScreenConfig=ElementOnScreenConfig}(bnt=bnt||{}),function(bnt){var OverlayScreenConfig=function(_super){function OverlayScreenConfig(config){var _this=_super.call(this,config)||this;return _this.configureCloseButton(config.closeButton),_this}return __extends(OverlayScreenConfig,_super),OverlayScreenConfig.prototype.configureCloseButton=function(config){this.closeButton=new bnt.CloseButtonConfig(config=void 0===config?{}:config)},__decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],OverlayScreenConfig)}(bnt.ScreenConfig);bnt.OverlayScreenConfig=OverlayScreenConfig}(bnt=bnt||{}),function(bnt){var CloseButtonConfig=function(){function CloseButtonConfig(config){this.configureDimension(config=void 0===config?{}:config,bnt.Defaults.closeButton),this.zIndex=6e4}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.DimensionConfig),__metadata("design:paramtypes",[Object])],CloseButtonConfig)}();bnt.CloseButtonConfig=CloseButtonConfig}(bnt=bnt||{}),function(bnt){var TextBoxConfig=function(){function TextBoxConfig(config){this.text=bnt.withDefault((config=void 0===config?{}:config).text,bnt.Defaults.textBox.text),this.configureTextFormatting(config,bnt.Defaults.textFormatting),this.configureDimension(config,bnt.Defaults.textBox),this.configureAngle(config,bnt.Defaults.textBox),this.configureText(config,bnt.Defaults.textBox),this.configureVisibility(config,bnt.Defaults.textBox),this.configureOpacity(config,bnt.Defaults.textBox)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.DimensionConfig,bnt.TextFormattingConfig,bnt.RotationConfig,bnt.TextConfig,bnt.VisibilityConfig,bnt.OpacityConfig),__metadata("design:paramtypes",[Object])],TextBoxConfig)}();bnt.TextBoxConfig=TextBoxConfig}(bnt=bnt||{}),function(bnt){var HtmlBoxConfig=function(){function HtmlBoxConfig(config){this.configureVisibility(config=void 0===config?{}:config,bnt.Defaults.htmlBox),this.configureDimension(config,bnt.Defaults.htmlBox),this.configureAngle(config,bnt.Defaults.htmlBox)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.DimensionConfig,bnt.VisibilityConfig,bnt.RotationConfig),__metadata("design:paramtypes",[Object])],HtmlBoxConfig)}();bnt.HtmlBoxConfig=HtmlBoxConfig}(bnt=bnt||{}),function(bnt){var ShapeConfig=function(){function ShapeConfig(config){this.configureDimension(config=void 0===config?{}:config,bnt.Defaults.shape),this.configureAngle(config,bnt.Defaults.shape),this.configureVisibility(config,bnt.Defaults.shape),this.configureOpacity(config,bnt.Defaults.shape),this.backgroundColor=bnt.withDefault(config.backgroundColor,bnt.Defaults.shape.backgroundColor),this.radius=bnt.withDefault(config.radius,bnt.Defaults.shape.radius),this.border=bnt.withDefault(config.border,bnt.Defaults.shape.border),this.borderColor=bnt.withDefault(config.borderColor,bnt.Defaults.shape.borderColor)}return __decorate([bnt.Mixin(bnt.DimensionConfig,bnt.RotationConfig,bnt.VisibilityConfig,bnt.OpacityConfig),bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),__metadata("design:paramtypes",[Object])],ShapeConfig)}();bnt.ShapeConfig=ShapeConfig}(bnt=bnt||{}),function(bnt){var HotspotConfig=function(){function HotspotConfig(config){this.configureDimension(config=void 0===config?{}:config,bnt.Defaults.hotspot),this.radius=bnt.withDefault(config.radius,bnt.Defaults.hotspot.radius),this.configureAngle(config,bnt.Defaults.hotspot),this.configureVisibility(config,bnt.Defaults.hotspot)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.DimensionConfig,bnt.RotationConfig,bnt.VisibilityConfig),__metadata("design:paramtypes",[Object])],HotspotConfig)}();bnt.HotspotConfig=HotspotConfig}(bnt=bnt||{}),function(bnt){var GroupConfig=function(){function GroupConfig(config){this.configurePosition(config=void 0===config?{}:config,bnt.Defaults.group),this.configureDimension(config,bnt.Defaults.group),this.configureVisibility(config,bnt.Defaults.group),this.configureOpacity(config,bnt.Defaults.group),this.configureAngle(config,bnt.Defaults.group),this.configureOnHide(config.onHide),this.configureOnShow(config.onShow)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.PositionConfig,bnt.DimensionConfig,bnt.VisibilityConfig,bnt.TransitionConfig,bnt.OpacityConfig,bnt.RotationConfig),__metadata("design:paramtypes",[Object])],GroupConfig)}();bnt.GroupConfig=GroupConfig}(bnt=bnt||{}),function(bnt){var TargetVideoConfig=function(){function TargetVideoConfig(){}return TargetVideoConfig.prototype.configureTargetVideo=function(config,defaults){this.targetVideo=bnt.withDefault(config.targetVideo,defaults.targetVideo)},__decorate([bnt.Serializable({})],TargetVideoConfig)}();bnt.TargetVideoConfig=TargetVideoConfig}(bnt=bnt||{}),function(bnt){var VisibleOnMuteConfig=function(){function VisibleOnMuteConfig(){}return VisibleOnMuteConfig.prototype.configureVisibleOnMute=function(config,defaults){this.visibleOnMute=bnt.withDefault(config.visibleOnMute,defaults.visibleOnMute)},__decorate([bnt.Serializable({})],VisibleOnMuteConfig)}();bnt.VisibleOnMuteConfig=VisibleOnMuteConfig}(bnt=bnt||{}),function(bnt){var SubtitleConfig=function(){function SubtitleConfig(config){this.subtitleActions=bnt.withDefault((config=void 0===config?{}:config).subtitleActions,bnt.Defaults.subtitle.subtitleActions),this.configureTextFormatting(config,bnt.Defaults.textFormatting),this.configureDimension(config,bnt.Defaults.subtitle),this.configureAngle(config,bnt.Defaults.subtitle),this.configureSrc(config,bnt.Defaults.subtitle),this.configureTargetVideo(config,bnt.Defaults.subtitle),this.configureVisibility(config,bnt.Defaults.subtitle),this.configureOpacity(config,bnt.Defaults.subtitle),this.configureVisibleOnMute(config,bnt.Defaults.subtitle)}return __decorate([bnt.Serializable({transientTypes:[bnt.Observable,bnt.ObservableValue]}),bnt.Mixin(bnt.TargetVideoConfig,bnt.SrcConfig,bnt.DimensionConfig,bnt.TextFormattingConfig,bnt.RotationConfig,bnt.VisibilityConfig,bnt.OpacityConfig,bnt.VisibleOnMuteConfig),__metadata("design:paramtypes",[Object])],SubtitleConfig)}();bnt.SubtitleConfig=SubtitleConfig}(bnt=bnt||{}),function(bnt){function rel(a,b){return Math.abs((b-a)/a)}bnt.Dimension=function(){};var CanvasChangeDetector=function(){function CanvasChangeDetector(dimensionChange,possibleCanvases){var _this=this;this.possibleCanvases=possibleCanvases,this.canvasChange=new bnt.Observable,this.onDimensionUpdated=function(dim){_this.canvasChange.update(_this.selectColosestCanvas(dim.width,dim.height))},dimensionChange.addObserver(function(dim){return _this.onDimensionUpdated(dim)})}return CanvasChangeDetector.prototype.selectColosestCanvas=function(width,first){var ideal=new bnt.Canvas(new bnt.CanvasConfig({width:width,height:first})),first=new bnt.SortedSet(function(a){return a.delta}).with(this.possibleCanvases.map(function(canvas){return{canvas:canvas,delta:2*rel(canvas.getAspectRatio(),ideal.getAspectRatio())+rel(canvas.config.width,ideal.config.width)}})).first();if(first)return first.canvas;throw new Error("There's water in the basement and the pilot light is out.")},CanvasChangeDetector}();bnt.CanvasChangeDetector=CanvasChangeDetector}(bnt=bnt||{}),function(bnt){var BannerStage=function(){function BannerStage(){}var BannerStage_1=BannerStage;return BannerStage.prototype.init=function(){var _this=this;bnt.set(BannerStage_1,this),this.creative=bnt.get(bnt.Creative),this.stateChangeDetector=new bnt.StateChangeDetector(this.creative.segments,this.canvases),this.localResizeController=new bnt.ResizeController,this.localResizeController.init(),bnt.withVals([[bnt.ResizeController,this.localResizeController]],function(){return _this.stateChangeDetector.init()}),this.stateChangeDetector.stateUpdated.addObserver(function(state){_this.lastState=state,bnt.set(bnt.State,state),_this.applyCanvasConfig(state)}),this.renderer=bnt.withVals([[bnt.StateChangeDetector,this.stateChangeDetector]],function(){return new bnt.ScreenRenderer(_this.screen)}),this.renderer.init(),bnt.get(bnt.MainStage).autoStart=!1,bnt.get(bnt.MainStage).applyBackground=!1},BannerStage.prototype.load=function(){return this.renderer.load()},BannerStage.prototype.updateScale=function(state){var translateX=this.localResizeController.previous.width,translateY=this.localResizeController.previous.height,scaleX=translateX/state.canvas.config.width,scale=translateY/state.canvas.config.height,scale=Math.min(scaleX,scale),translateX=bnt.px((translateX-state.canvas.config.width*scale)/2),translateY=bnt.px((translateY-state.canvas.config.height*scale)/2);this.htmlElement()&&bnt.style(this.htmlElement(),{width:bnt.px(state.canvas.config.width),height:bnt.px(state.canvas.config.height),top:translateY,left:translateX,transformOrigin:"0 0",transform:"scale("+scale+","+scale+")"})},BannerStage.prototype.applyCanvasConfig=function(state){this.htmlElement&&(bnt.style(this.htmlElement(),{position:"absolute"}),this.updateScale(state))},BannerStage.prototype.renderMe=function(target){var htmlElement=bnt.createElement("div",target);htmlElement.style.position="relative",htmlElement.hidden=!0,this.htmlElement=function(){return htmlElement}},BannerStage.prototype.render=function(target){var _this=this;return this.parentElement=function(){return target},this.renderMe(target),bnt.withVals([[bnt.StateChangeDetector,this.stateChangeDetector]],function(){return _this.renderer.render(_this.htmlElement())})},BannerStage.prototype.showStage=function(){var _this=this;requestAnimationFrame(function(){});var p1=bnt.withVals([[bnt.State,this.lastState]],function(){return new bnt.ScreenTransition(_this.htmlElement())}).switchBetween(null,this.renderer);return this.htmlElement().hidden=!1,p1},BannerStage.prototype.start=function(){return this.localResizeController.start(),this.showStage()},BannerStage.prototype.hideStage=function(){var _this=this;return bnt.withVals([[bnt.State,this.lastState]],function(){return new bnt.ScreenTransition(_this.htmlElement())}).switchBetween(this.renderer,null).map(function(){_this.htmlElement().hidden=!0})},BannerStage.prototype.getState=function(){return this.stateChangeDetector.getState()},__decorate([bnt.Transient,__metadata("design:type",bnt.ScreenRenderer)],BannerStage.prototype,"renderer",void 0),__decorate([bnt.Transient,__metadata("design:type",Function)],BannerStage.prototype,"htmlElement",void 0),__decorate([bnt.Transient,__metadata("design:type",Function)],BannerStage.prototype,"parentElement",void 0),__decorate([bnt.Transient,__metadata("design:type",bnt.Creative)],BannerStage.prototype,"creative",void 0),__decorate([bnt.Transient,__metadata("design:type",bnt.ResizeController)],BannerStage.prototype,"localResizeController",void 0),__decorate([bnt.Transient,__metadata("design:type",bnt.StateChangeDetector)],BannerStage.prototype,"stateChangeDetector",void 0),BannerStage_1=__decorate([bnt.Serializable({})],BannerStage)}();bnt.BannerStage=BannerStage}(bnt=bnt||{}),function(bnt){var MainStage=function(){function MainStage(){var _this=this;this.renderersMap=new bnt.Map(new bnt.ScreenHash),this.state=bnt.lazyGet(bnt.State),this.rendered=!1,this.stateChangeDetector=bnt.lazyGet(bnt.StateChangeDetector),this.autoStart=!0,this.applyBackground=!0,this.inited=!1,this.animationFinalizers={},this.scrollDrivenPropertyChangesByElementId={},this.boundUpdateScrollPercentage=this.updateScrollPercentage.bind(this),this.updateTimeClosure=function(value){_this.creative.timeMillisec.update(value)},this.updateRemainingTimeClosure=function(value){_this.creative.remainingTimeMillisec.update(value)},this.updateDurationClosure=function(value){_this.creative.duration.update(value)},this.updateOnEndClosure=function(){_this.creative.onend.update(void 0)},this.stateChangeDetector().stateUpdated.addObserver(function(state){return _this.applyState()}),bnt.get(bnt.ResizeController).resize.addObserver(function(_){return _this.updateScale()}),bnt.set(MainStage,this)}return MainStage.prototype.applyState=function(){var state=bnt.get(bnt.State);bnt.get(bnt.CreativeRenderer).onstatechange.update(state),this.applyCanvasConfig(state)},MainStage.prototype.currentRenderer=function(){return this.currentScreen&&this.renderersMap.get(this.currentScreen)},MainStage.prototype.render=function(target){return void 0===target&&(target=this.container),this.container=target,this.rendered=!0,this.renderMe(target),this.currentRenderer().render(this.htmlElement)},MainStage.prototype.renderMe=function(target){this.htmlElement=bnt.createElement("div",target),this.htmlElement.style.position="relative",this.htmlElement.style.overflow="hidden",this.htmlElement.hidden=!0,document.body.appendChild(this.getMainStageStyle()),this.applyCanvasConfig(this.state())},MainStage.prototype.getMainStageStyle=function(){var style=document.createElement("style");return style.innerHTML="\n      * {\n        animation-duration: 0.4s;\n      }\n      ",style},MainStage.prototype.updateScale=function(){var state=bnt.get(bnt.State),translateY=bnt.get(bnt.ResizeController).previous,translateX=translateY.width,translateY=translateY.height,scaleX=translateX/state.canvas.config.width,scale=translateY/state.canvas.config.height,scale=Math.min(scaleX,scale),translateX=bnt.px((translateX-state.canvas.config.width*scale)/2),translateY=bnt.px((translateY-state.canvas.config.height*scale)/2);this.htmlElement&&bnt.style(this.htmlElement,{width:bnt.px(state.canvas.config.width),height:bnt.px(state.canvas.config.height),top:translateY,left:translateX,transformOrigin:"0 0",transform:"scale("+scale+","+scale+")"})},MainStage.prototype.applyCanvasConfig=function(state){var backgroundStyles;this.htmlElement&&(this.applyBackground&&this.currentScreen&&(backgroundStyles=bnt.getStyleForBackgroundConfig(this.currentScreen.config),bnt.style(this.htmlElement,backgroundStyles)),bnt.style(this.htmlElement,{position:"absolute"}),this.updateScale())},MainStage.prototype.init=function(){var _this=this;this.inited=!0,this.creative=bnt.get(bnt.Creative),this.creative.forEachScreen(function(screen){var renderer=new bnt.ScreenRenderer(screen);renderer.init(),_this.renderersMap.put(screen,renderer)}),this.currentScreen=this.creative.firstScreen()},MainStage.prototype.start=function(){return this.autoStart?(bnt.logger.log("start main stage"),this.showStage()):bnt.Promise.fulfilledWith(null).future},MainStage.prototype.load=function(){return this.currentRenderer().load()},MainStage.prototype.preloadScreens=function(toPreload){var _this=this,toPreload=this.creative.screensToPreload.get(toPreload);toPreload&&toPreload.map(function(screen){return _this.renderersMap.get(screen).load()})},MainStage.prototype.setScreenObservers=function(screen){screen.remainingTimeMillisec.addObserver(this.updateRemainingTimeClosure),screen.duration.addObserver(this.updateDurationClosure),screen.timeMillisec.addObserver(this.updateTimeClosure),screen.onend.addObserver(this.updateOnEndClosure)},MainStage.prototype.removeScreenObservers=function(screen){screen.remainingTimeMillisec.removeObserver(this.updateRemainingTimeClosure),screen.duration.removeObserver(this.updateDurationClosure),screen.timeMillisec.removeObserver(this.updateTimeClosure),screen.onend.removeObserver(this.updateOnEndClosure)},MainStage.prototype.showStage=function(){var _this=this;return this.inited||(this.init(),this.render()),this.setScreenObservers(this.currentScreen),this.htmlElement.hidden=!1,this.switchBetween(null,this.currentScreen).map(function(){return _this.preloadScreens(_this.currentScreen)})},MainStage.prototype.hideStage=function(){var _this=this;return new bnt.ScreenTransition(this.htmlElement).switchBetween(this.currentRenderer(),null).map(function(){return _this.htmlElement.hidden=!0})},MainStage.prototype.destroyStage=function(){var _this=this;return this.inited=!1,this.switchBetween(this.currentScreen,null).flatMap(function(){return bnt.Promise.forAll(_this.renderersMap.mapToArray(function(screen,renderer){return renderer.destroy()}))}).map(function(){_this.rendered=!1,_this.htmlElement&&_this.htmlElement.parentNode&&_this.htmlElement.parentNode.removeChild(_this.htmlElement)})},MainStage.prototype.switchBetween=function(screen1,screen2,switchTransition){var _this=this,transition=new bnt.ScreenTransition(this.htmlElement);return(screen2?this.renderersMap.get(screen2).load().flatMap(function(){return _this.renderersMap.get(screen2).render(_this.htmlElement)}):bnt.Promise.fulfilledWith(null).future).flatMap(function(){return _this.currentScreen=screen2,transition.switchBetween(screen1?_this.renderersMap.get(screen1):null,screen2?_this.renderersMap.get(screen2):null,switchTransition)})},MainStage.prototype.playSceneAnimation=function(sceneId){var playAnimationOnElement_1,_this=this,scene=this.getSceneById(sceneId);return scene&&(playAnimationOnElement_1=(scene.scrollDriven?this.playScrollDrivenSceneAnimationOnElement:this.playSceneAnimationOnElement).bind(this),Object.keys(scene.elementAnimations).forEach(function(elementId){_this.stopSceneAnimationOnElement(elementId),playAnimationOnElement_1(scene,elementId)})),bnt.Promise.fulfilledWith(void 0).future},MainStage.prototype.switchTo=function(screenName,transition){var sheet,_this=this,fromScreen=this.currentScreen,toScreen=this.creative.getScreen(screenName);return fromScreen==toScreen?bnt.Promise.fulfilledWith(void 0).future:(fromScreen&&toScreen&&transition&&((sheet=document.createElement("style")).id=bnt.Animation.composeTransStyleId(fromScreen.name,transition.name,transition.duration||0,toScreen.name),sheet.innerHTML+="\n"+bnt.Animation.createAnimForScreenTransition(screenName,transition.in,transition.duration||0)+"\n"+bnt.Animation.createAnimForScreenTransition(fromScreen.name,transition.out,transition.duration||0),document.getElementById(sheet.id)||document.body.appendChild(sheet)),this.switchBetween(fromScreen,toScreen,transition).map(function(){_this.removeScreenObservers(fromScreen),_this.creative.onmainscreen.update(toScreen==_this.creative.screens[0]),_this.creative.onscreenchange.update({from:fromScreen,to:toScreen}),_this.setScreenObservers(toScreen),_this.preloadScreens(toScreen),fromScreen.config.onHide=new bnt.AnimationConfig({}),toScreen.config.onShow=new bnt.AnimationConfig({})}))},MainStage.prototype.getSceneById=function(sceneId){return this.currentScreen.getScenesById(this.state())[sceneId]},MainStage.prototype.stopSceneAnimationOnElement=function(elementId){this.animationFinalizers[elementId]&&this.animationFinalizers[elementId](),delete this.animationFinalizers[elementId]},MainStage.prototype.playSceneAnimationOnElement=function(scene,elementId){var _this=this,elementAnimation=bnt.getSceneClassName(this.currentScreen,scene),classNameForElement="".concat(elementAnimation,"_").concat(elementId),listenerAborters=[],elementAnimation=scene.elementAnimations[elementId];bnt.getAnimatedDivs(elementId,elementAnimation).forEach(function(animatedDiv){listenerAborters.push(bnt.addAbortableListener(animatedDiv,"animationiteration",function(){return bnt.pinElementFinalKeyframeAnimationState(_this.currentScreen,_this.state(),scene,elementId,scene.elementAnimations[elementId])},{once:!0})),listenerAborters.push(bnt.addAbortableListener(animatedDiv,"animationend",function(){return bnt.pinElementAnimationState(elementId)},{once:!0}))}),this.animationFinalizers[elementId]=function(){listenerAborters.forEach(function(abort){return abort()}),bnt.pinElementAnimationState(elementId),_this.htmlElement.classList.remove(classNameForElement)},setTimeout(function(){_this.htmlElement.classList.add(classNameForElement)})},MainStage.prototype.playScrollDrivenSceneAnimationOnElement=function(scene,elementId){var _this=this,scrollController=bnt.get(bnt.ScrollController),scrollPercentageObservable=scrollController.scrollPercentage,elementPropertyChanges=scene.elementAnimations[elementId],elementPropertyChanges=bnt.computePropertyChangesForElement(this.currentScreen,this.state(),scene,elementId,elementPropertyChanges);elementPropertyChanges&&(this.scrollDrivenPropertyChangesByElementId[elementId]=elementPropertyChanges,scrollController.previousScrollPercentage&&bnt.setElementAnimationState(this.currentScreen,this.state(),elementId,elementPropertyChanges,scrollController.previousScrollPercentage),scrollPercentageObservable.hasObserver(this.boundUpdateScrollPercentage)||scrollPercentageObservable.addObserver(this.boundUpdateScrollPercentage),this.animationFinalizers[elementId]=function(){delete _this.scrollDrivenPropertyChangesByElementId[elementId],_this.anyScrollDrivenAnimationsActive()||scrollPercentageObservable.removeObserver(_this.boundUpdateScrollPercentage)})},MainStage.prototype.anyScrollDrivenAnimationsActive=function(){return 0<Object.keys(this.scrollDrivenPropertyChangesByElementId).length},MainStage.prototype.updateScrollPercentage=function(scrollPercentage){var _this=this;Object.entries(this.scrollDrivenPropertyChangesByElementId).forEach(function(elementId){var elementPropertyChanges=__read(elementId,2),elementId=elementPropertyChanges[0],elementPropertyChanges=elementPropertyChanges[1];return bnt.setElementAnimationState(_this.currentScreen,_this.state(),elementId,elementPropertyChanges,scrollPercentage)})},MainStage}();bnt.MainStage=MainStage}(bnt=bnt||{}),function(bnt){var StateChangeDetector=function(){function StateChangeDetector(segments,canvases){this.segments=segments,this.canvases=canvases,this.id=bnt.IdClass.getNext(),this.stateUpdated=new bnt.Observable}return StateChangeDetector.prototype.update=function(){var state;this.segment&&this.canvas&&(state=this.getState(),this.currentState&&state.hash()==this.currentState.hash()||(this.currentState=state,this.stateUpdated.update(this.currentState)))},StateChangeDetector.prototype.getState=function(){return new bnt.State({segment:this.segment,canvas:this.canvas})},StateChangeDetector.prototype.init=function(){var _this=this;this.canvasCD=new bnt.CanvasChangeDetector(bnt.get(bnt.ResizeController).resize,this.canvases),this.segmentsCD=new bnt.SegmentChangeDetector(this.segments),this.segmentsCD.segmentUpdated.addObserver(function(segment){_this.segment=segment,_this.update()}),this.canvasCD.canvasChange.addObserver(function(canvas){_this.canvas=canvas,_this.update()}),this.segmentsCD.init()},StateChangeDetector}();bnt.StateChangeDetector=StateChangeDetector}(bnt=bnt||{}),function(bnt){function conjunctionReducer(a,b){return a&&b}function bestSegmentReducer(a,b){return a.signalHolders.length>b.signalHolders.length?a:b}function activeSegmentFilter(a){return a.signalHolders.map(function(signalHolder){return signalHolder.signal.isActive()}).reduce(conjunctionReducer,!0)}var SegmentChangeDetector=function(){function SegmentChangeDetector(segments){this.segments=segments,this.segmentUpdated=new bnt.Observable}return SegmentChangeDetector.prototype.init=function(){var uuid_1,segments,_this=this;bnt.QueryParams.has("segment")?(uuid_1=bnt.QueryParams.get("segment"),(segments=this.segments.filter(function(s){return s.uuid==uuid_1})).length?this.segmentUpdated.update(segments[0]):console.error("Cannot find the segment with uuid '".concat(uuid_1,"'"))):(this.updateSegment(),bnt.get(bnt.SignalController).signalsUpdated.addObserver(function(){return _this.updateSegment()})),this.initPreview()},SegmentChangeDetector.prototype.initPreview=function(){var _this=this;window&&window.addEventListener("message",function(e){var segments;e.data&&e.data.type&&("segment"==e.data.type?(bnt.get(bnt.SignalController).removeObservers(),(segments=_this.segments.filter(function(s){return s.uuid==e.data.uuid})).length&&(bnt.DynamicData.clear(),_this.segmentUpdated.update(segments[0]))):"resetSegment"==e.data.type&&bnt.get(bnt.SignalController).addObservers())})},SegmentChangeDetector.prototype.updateSegment=function(){var bestSegment=SegmentChangeDetector.GetMostSuitableSegment(this.segments);bestSegment&&this.segmentUpdated.update(bestSegment)},SegmentChangeDetector.GetMostSuitableSegment=function(segments){return segments.filter(activeSegmentFilter).reduce(bestSegmentReducer)},SegmentChangeDetector}();bnt.SegmentChangeDetector=SegmentChangeDetector}(bnt=bnt||{}),function(bnt){var SignalController=function(){function SignalController(){this.signalsUpdated=new bnt.Observable,this.values=new bnt.Map(new bnt.FunctionHash),this.observers=new bnt.Map(new bnt.FunctionHash)}return SignalController.prototype.init=function(){this.addObservers()},SignalController.prototype.addObservers=function(){var type,_this=this,signalsUsedInCreative=[];for(type in bnt.get(bnt.Creative).segments.forEach(function(segment){segment.signalHolders.forEach(function(signalHolder){signalsUsedInCreative.push(signalHolder.signal.constructor)})}),bnt.signals)bnt.signals[type].forEach(function(signalCtor){var observer;-1!=signalsUsedInCreative.indexOf(signalCtor)&&(signalCtor.init(),signalCtor.value.addObserver(observer=function(value){_this.values.put(signalCtor,value),_this.signalsUpdated.update({changed:signalCtor,values:_this.values})}),_this.observers.put(signalCtor,observer))})},SignalController.prototype.removeObservers=function(){this.observers.forEach(function(signalCtor,observer){signalCtor.value.removeObserver(observer)}),this.observers=new bnt.Map(new bnt.FunctionHash)},__decorate([bnt.Singleton],SignalController)}();bnt.SignalController=SignalController}(bnt=bnt||{}),function(bnt){var DynamicData=function(){function DynamicData(){}return DynamicData.init=function(){DynamicData.inited||(DynamicData.inited=!0,DynamicData.loadDataFromQueryParams(),DynamicData.loadDataFromAdParameters(),DynamicData.listenToOutsideChanges())},DynamicData.addData=function(key,value){DynamicData.data.put(key,value)},DynamicData.getData=function(key){return DynamicData.data.get(key)},DynamicData.hasData=function(key){return DynamicData.data.contains(key)},DynamicData.clear=function(){DynamicData.data.clear()},DynamicData.loadDataFromQueryParams=function(){bnt.QueryParams.has("dynamicData")&&bnt.QueryParams.get("dynamicData").split("|").map(function(pair){return pair.split(":")}).map(function(pair){DynamicData.addData(pair[0],pair[1])})},DynamicData.loadDataFromAdParameters=function(){var dynamicData_1;bntAdParameters&&bntAdParameters.hasOwnProperty("dynamicData")&&(dynamicData_1=bntAdParameters.dynamicData,Object.keys(dynamicData_1).forEach(function(k){return DynamicData.addData(k,dynamicData_1[k])}))},DynamicData.listenToOutsideChanges=function(){window.addEventListener("message",function(e){var shouldUpdate_2;e.data&&e.data.type&&"dynamicData"==e.data.type&&(shouldUpdate_2=!1,Object.keys(e.data.data).forEach(function(k){DynamicData.getData(k)!=e.data.data[k]&&(DynamicData.addData(k,e.data.data[k]),shouldUpdate_2=!0)}),shouldUpdate_2&&DynamicData.onDataChange.update(void 0))})},DynamicData.inited=!1,DynamicData.data=new bnt.Map(new bnt.StringHash),DynamicData.onDataChange=new bnt.Observable,DynamicData}();bnt.DynamicData=DynamicData}(bnt=bnt||{}),function(bnt){var SIDE;!function(SIDE){SIDE[SIDE.NONE=0]="NONE",SIDE[SIDE.WIDTH=1]="WIDTH",SIDE[SIDE.HEIGHT=2]="HEIGHT"}(SIDE=bnt.SIDE||(bnt.SIDE={}));var ScaleToFill=function(){function ScaleToFill(){}return ScaleToFill.getSizes=function(vw,vh,ew,eh,sizes){void 0===sizes&&(sizes=SIDE.NONE);var referenceSide=ScaleToFill.getSide(ew,eh,vw,vh),sizes={w:0,h:0,x:0,y:0,side:referenceSide=sizes==SIDE.NONE?referenceSide:sizes};return referenceSide==SIDE.WIDTH?(sizes.w=vw,sizes.h=eh/(ew/vw),sizes.x=0,sizes.y=(vh-sizes.h)/2):referenceSide==SIDE.HEIGHT&&(sizes.w=ew/(eh/vh),sizes.h=vh,sizes.x=(vw-sizes.w)/2,sizes.y=0),sizes},ScaleToFill.getSide=function(ew,eh,vw,vh){var side=eh<ew?SIDE.HEIGHT:SIDE.WIDTH;return side==SIDE.WIDTH?eh/(ew/vw)<vh&&(side=SIDE.HEIGHT):side==SIDE.HEIGHT&&ew/(eh/vh)<vw&&(side=SIDE.WIDTH),side},ScaleToFill}();bnt.ScaleToFill=ScaleToFill}(bnt=bnt||{}),function(bnt){var DeviceOrientation=function(){function DeviceOrientation(){}return DeviceOrientation.init=function(){DeviceOrientation.inited=!0,window.addEventListener("deviceorientation",DeviceOrientation.deviceOrientationListener,!0)},DeviceOrientation.deviceOrientationListener=function(raw){var raw={alpha:raw.alpha||0,beta:raw.beta||0,gamma:raw.gamma||0},response={raw:raw,continuous:DeviceOrientation.getContinuousRotations(raw)};DeviceOrientation.fns.forEach(function(fn){fn(response)})},DeviceOrientation.getContinuousRotations=function(raw){return null==DeviceOrientation.previousRotations&&(DeviceOrientation.previousRotations=raw),null==DeviceOrientation.continuousRotations&&(DeviceOrientation.continuousRotations=raw),this.offsetRotations.alpha=DeviceOrientation.updateRotationOffset(this.offsetRotations.alpha,raw.alpha-180,DeviceOrientation.previousRotations.alpha-180),this.offsetRotations.beta=DeviceOrientation.updateRotationOffset(this.offsetRotations.beta,raw.beta,DeviceOrientation.previousRotations.beta),this.offsetRotations.gamma=DeviceOrientation.updateRotationOffset(this.offsetRotations.gamma,raw.gamma,DeviceOrientation.previousRotations.gamma),DeviceOrientation.continuousRotations.alpha=raw.alpha+360*this.offsetRotations.alpha,DeviceOrientation.continuousRotations.beta=raw.beta+360*this.offsetRotations.beta,DeviceOrientation.continuousRotations.gamma=raw.gamma+180*this.offsetRotations.gamma,DeviceOrientation.previousRotations=raw,DeviceOrientation.continuousRotations},DeviceOrientation.updateRotationOffset=function(offsetMultiplier,previousValue,currentValueSgn){return DeviceOrientation.isPointBetween(previousValue,-45,45)||DeviceOrientation.isPointBetween(currentValueSgn,-45,45)||DeviceOrientation.sgn(previousValue)!=(currentValueSgn=DeviceOrientation.sgn(currentValueSgn))&&(1==currentValueSgn?offsetMultiplier++:offsetMultiplier--),offsetMultiplier},DeviceOrientation.isPointBetween=function(value,left,right){return left<=value&&value<=right},DeviceOrientation.sgn=function(value){return value<0?-1:1},DeviceOrientation.subscribe=function(fn){return DeviceOrientation.inited||DeviceOrientation.init(),DeviceOrientation.fns.push(fn),{unsubscribe:DeviceOrientation.unsubscribe.bind(this,fn)}},DeviceOrientation.unsubscribe=function(i){i=DeviceOrientation.fns.indexOf(i);1!=i&&DeviceOrientation.fns.splice(i,1)},DeviceOrientation.inited=!1,DeviceOrientation.fns=[],DeviceOrientation.offsetRotations={alpha:0,beta:0,gamma:0},DeviceOrientation}();bnt.DeviceOrientation=DeviceOrientation}(bnt=bnt||{}),function(bnt){bnt.requestAnimFrame=function(callback){if("undefined"!=typeof window)return getWindowExtended().requestAnimFrame(callback)},bnt.cancelAnimFrame=function(requestId){"undefined"!=typeof window&&getWindowExtended().cancelAnimFrame(requestId)}}(bnt=bnt||{}),"undefined"!=typeof window&&(getWindowExtended().requestAnimFrame=getWindowExtended().requestAnimationFrame||getWindowExtended().webkitRequestAnimationFrame||getWindowExtended().mozRequestAnimationFrame||function(callback){return window.setTimeout(callback,1e3/60)},getWindowExtended().cancelAnimFrame=getWindowExtended().cancelAnimationFrame||getWindowExtended().webkitCancelAnimationFrame||getWindowExtended().mozCancelAnimationFrame||clearTimeout),function(bnt){bnt.RendererOf=function(elementType,condition,priority){return function(target){bnt.ElementRendererRegistry.registerRenderer(elementType,target,condition,priority)}}}(bnt=bnt||{}),function(bnt){var Animation=function(){function Animation(){var _this=this;this.animationEnd=new bnt.Promise,this.animationPerformed=new bnt.Promise,this.complete=new bnt.Promise,this.completed=!1,this.twoPhase=!1,this.animationEnd.future.onComplete(function(_){_this.twoPhase||_this.complete.fulfill(_)})}return Object.defineProperty(Animation.prototype,"onComplete",{get:function(){return this.complete.future},enumerable:!1,configurable:!0}),Animation.of=function(element,elementId,stateHash,animation){if(animation&&animation.name){var classNames=["animated"],duration=1e3;return animation.name&&(classNames.push(animation.name),classNames.push(Animation.composeAnimClassName(elementId,stateHash,animation.name)),duration=1e3*animation.duration*animation.repeat),new ActualAnimation(element,classNames,duration)}return new DummyAnimation},Animation.join=function(animations){animations.forEach(function(animation){animation.twoPhase=!0});var future=bnt.Promise.forAll(animations.map(function(animation){return animation.animationEnd.future}));return future.onComplete(function(){animations.forEach(function(animation){return animation.complete.succeed(null)})}),future},Animation.createAnimForScreenTransition=function(targetElement,animationName,duration){return".".concat(Animation.composeAnimClassName(targetElement,bnt.lazyGet(bnt.State)().hash(),animationName)," {\n                animation-duration: ").concat(duration,"s;\n             }")},Animation.createAnimStyle=function(elementId,stateHash,config){function anim(animConfig){return".".concat(Animation.composeAnimClassName(elementId,stateHash,animConfig.name)," {\n          animation-duration: ").concat(animConfig.duration,"s;\n          \n          animation-iteration-count: ").concat(0==animConfig.repeat?"infinite":animConfig.repeat,";\n          \n          animation-timing-function: ").concat(animConfig.ease,";\n        }")}return anim(config.onShow)+"\n"+anim(config.onHide)},Animation.composeAnimClassName=function(elementId,stateHash,animName){return"".concat(elementId,"_").concat(stateHash,"_").concat(animName)},Animation.composeTransStyleId=function(fromScreen,transitionName,transitionDuration,toScreen){return"".concat(fromScreen,"_").concat(transitionName||"noTransition","_").concat(transitionDuration,"_").concat(toScreen)},Animation.prototype.animationEnded=function(){this.completed=!0,this.animationEnd.fulfilled||this.animationEnd.succeed(null)},Animation.prototype.animationCanceled=function(){this.completed=!0},Object.defineProperty(Animation.prototype,"onAnimationPerformed",{get:function(){return this.animationPerformed.future},enumerable:!1,configurable:!0}),Animation.prototype.cancel=function(){this.completed||(this.clean(),this.animationCanceled())},Animation}(),ActualAnimation=function(_super){function ActualAnimation(element,classNames,duration){var _this=_super.call(this)||this;_this.element=element;var $this=_this;function clean(){element.removeEventListener("webkitAnimationEnd",onAnimationEnd),element.removeEventListener("animationend",onAnimationEnd),classNames.forEach(function(className){return element.classList.remove(className)}),$this.completed=!0}function onAnimationEnd(e){e&&element!=e.target||(clean(),$this.animationEnd.succeed(null),$this.animationPerformed.succeed(null))}var animating=!1;function onAnimationStart(){animating=!0,element.removeEventListener("animationstart",onAnimationStart),element.removeEventListener("webkitAnimationStart",onAnimationStart),0!=duration&&setTimeout(function(){$this.completed||(console.warn("animation not ended",classNames,"hidden?",element.hidden,"parent hidden?",element.parentElement?element.parentElement.hidden:"N/A"),onAnimationEnd())},duration+1e3)}return _this.clean=clean,classNames.forEach(function(className){return element.classList.add(className)}),element.addEventListener("webkitAnimationEnd",onAnimationEnd),element.addEventListener("animationend",onAnimationEnd),element.addEventListener("animationstart",onAnimationStart),element.addEventListener("webkitAnimationStart",onAnimationStart),setTimeout(function(){animating||(console.warn("animation not started",classNames,"hidden?",element.hidden,"parent hidden?",element.parentElement?element.parentElement.hidden:"N/A"),onAnimationEnd())},500),_this}return __extends(ActualAnimation,_super),ActualAnimation}(bnt.Animation=Animation);bnt.ActualAnimation=ActualAnimation;var DummyAnimation=function(_super){function DummyAnimation(){var _this=_super.call(this)||this;return _this.clean=function(){return!0},bnt.Promise.asyncFulfilledWith(null).future.map(function(){return _this.animationEnded()}),_this.onComplete.onComplete(function(){return _this.animationPerformed.succeed(null)}),_this}return __extends(DummyAnimation,_super),DummyAnimation.prototype.cancel=function(){},DummyAnimation}(Animation);bnt.DummyAnimation=DummyAnimation;var CompoundAnimation=function(_super){function CompoundAnimation(animations){var _this=_super.call(this)||this;return _this.animations=animations,_this.clean=function(){_this.animations.forEach(function(a){return a.clean()})},Animation.join(animations).onComplete(function(){_this.animationEnd.succeed(null),_this.animationPerformed.succeed(null)}),_this}return __extends(CompoundAnimation,_super),CompoundAnimation.prototype.cancel=function(){this.animations.forEach(function(a){return a.cancel()})},CompoundAnimation}(Animation);bnt.CompoundAnimation=CompoundAnimation}(bnt=bnt||{}),function(bnt){var ScreenElements=function(a,b){this.a=a,this.b=b;var eas=new bnt.Set(new bnt.ElementOnScreenHash),ebs=new bnt.Set(new bnt.ElementOnScreenHash),e=new bnt.Set(new bnt.ElementOnScreenHash);a&&a.forEachEos(function(ea){eas.add(ea),e.add(ea)}),b&&b.forEachEos(function(eb){ebs.add(eb),e.add(eb)}),this.onlyInA=eas.missingFrom(ebs),this.onlyInB=ebs.missingFrom(eas),this.common=e.missingFrom(this.onlyInA).missingFrom(this.onlyInB)},ScreenTransition=function(){function ScreenTransition(containerElement){this.containerElement=containerElement,this.state=bnt.lazyGet(bnt.State)}return ScreenTransition.prototype.moveTo=function(container,elements){elements.map(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).htmlElement}).map(function(htmlElement){return container.appendChild(htmlElement)})},ScreenTransition.prototype.moveToContainer=function(elements){this.moveTo(this.containerElement,elements)},ScreenTransition.prototype.showScreen=function(screenRenderer,transition){return screenRenderer&&screenRenderer.screen?screenRenderer.showScreen(new bnt.AnimationConfig({name:transition?transition.in:"",delay:0,duration:(transition||bnt.Defaults.animation).duration,ease:bnt.Defaults.animation.ease,repeat:bnt.Defaults.animation.repeat})):new bnt.DummyAnimation},ScreenTransition.prototype.hideScreen=function(screenRenderer,transition){return screenRenderer&&screenRenderer.screen?screenRenderer.hideScreen(new bnt.AnimationConfig({name:transition?transition.out:"",delay:0,duration:(transition||bnt.Defaults.animation).duration,ease:bnt.Defaults.animation.ease,repeat:bnt.Defaults.animation.repeat})):new bnt.DummyAnimation},ScreenTransition.prototype.switchBetween=function(screenARenderer,transition,switchTransition){if(!ScreenTransition.currentTransition.completed)return bnt.Promise.fulfilledWith(null).future;screenARenderer&&screenARenderer.screen,transition&&transition.screen;transition=switchTransition&&switchTransition.name?this.switchWithTransition(screenARenderer,transition,switchTransition):this.switchWithoutTransition(screenARenderer,transition);return transition},ScreenTransition.prototype.switchWithTransition=function(screenARenderer,screenBRenderer,switchTransition){var _this=this,screenA=screenARenderer&&screenARenderer.screen,screenB=screenBRenderer&&screenBRenderer.screen,screenElements=new ScreenElements(screenA,screenB);return this.moveToContainer(screenElements.common.toArray()),bnt.Animation.join(screenElements.onlyInB.mapToArray(function(renderer){var state=_this.state(),eosConfig=renderer.getConfig(state),renderer=bnt.ElementRendererRegistry.rendererFor(renderer.element);return renderer.applyScreenConfig(state,eosConfig),renderer.show(!1)})).flatMap(function(){var screenBShowAnimation=_this.showScreen(screenBRenderer,switchTransition).onComplete,screenAHideAnimation=_this.hideScreen(screenARenderer,switchTransition).onComplete;return bnt.Promise.forAll([screenBShowAnimation,screenAHideAnimation]).flatMap(function(){return bnt.Animation.join(screenElements.onlyInA.mapToArray(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).hide(!1)}))})}).map(function(){return screenB&&_this.moveTo(screenBRenderer.screenElement,screenElements.common.toArray())})},ScreenTransition.prototype.switchWithoutTransition=function(screenARenderer,screenBRenderer){var _this=this,screenA=screenARenderer&&screenARenderer.screen,screenB=screenBRenderer&&screenBRenderer.screen,screenElements=new ScreenElements(screenA,screenB);return this.moveToContainer(screenElements.common.toArray()),bnt.Animation.join(screenElements.onlyInA.mapToArray(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).hide(!0)})).flatMap(function(){return _this.hideScreen(screenARenderer,null).onComplete}).flatMap(function(){var screenBShowAnimation=_this.showScreen(screenBRenderer,null);return bnt.Animation.join([screenBShowAnimation].concat(screenElements.onlyInB.mapToArray(function(renderer){var state=_this.state(),eosConfig=renderer.getConfig(state),renderer=bnt.ElementRendererRegistry.rendererFor(renderer.element);return renderer.applyScreenConfig(state,eosConfig),renderer.show(!0)})))}).map(function(){return screenB&&_this.moveTo(screenBRenderer.screenElement,screenElements.common.toArray())})},ScreenTransition.currentTransition=bnt.Promise.fulfilledWith(null).future,ScreenTransition}();bnt.ScreenTransition=ScreenTransition}(bnt=bnt||{}),function(bnt){var Point=function(){function Point(x,y){void 0===y&&(y=0),this.x=x=void 0===x?0:x,this.y=y}return Point.prototype.minus=function(p){return new Point(this.x-p.x,this.y-p.y)},Point.prototype.plus=function(point){return new Point(this.x+point.x,this.y+point.y)},Point.prototype.mul=function(value){return new Point(this.x*value,this.y*value)},Point.prototype.angle=function(){return Math.atan2(this.y,this.x)},Point.prototype.size=function(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))},Point.prototype.clone=function(){return new Point(this.x,this.y)},Object.defineProperty(Point,"zero",{get:function(){return new Point(0,0)},enumerable:!1,configurable:!0}),Point.from=function(x,y){return new Point(x,"number"==typeof y?y:x)},Point.ofTouchEvent=function(e){return new Point(e.changedTouches[0].pageX,e.changedTouches[0].pageY)},Point.ofMouseSwipeEvent=function(e){return new Point(e.pageX,e.pageY)},Point.Angle=function(one,two){return Math.atan2(two.y-one.y,two.x-one.x)},Point}();bnt.Point=Point}(bnt=bnt||{}),function(bnt){bnt.logger.debug("SOME SOME SOME SOME SOME");var ScreenRenderer=function(){function ScreenRenderer(screen){var _this=this;this.screen=screen,this.currentAnimation=new bnt.DummyAnimation,this.state=bnt.lazyGet(bnt.State),this.mouseSwiping=!1,this.adController=bnt.get(bnt.AdController),this.scrollController=bnt.get(bnt.ScrollController),this.loaded=!1,this.updateRemainTimeClosure=function(value){var rt=_this.screen.timeline.getRemainingTime();_this.screen.remainingTimeMillisec.update(rt),_this.screen.remainingTime.value!=Math.floor(rt)&&_this.screen.remainingTime.update(Math.floor(rt))},this.updateDurationClosure=function(value){_this.screen.duration.update(_this.screen.timeline.getDuration())},this.updateTimeClosure=function(value){var t=_this.screen.timeline.getTime();_this.screen.timeMillisec.update(t),_this.screen.time.value!=Math.floor(t)&&_this.screen.time.update(Math.floor(t))},this.updateScrollClosure=function(value){_this.screen.onscrollDown.update(value),_this.screen.onscrollUp.update(value)},this.updateOnEndClosure=function(){0===_this.screen.timeline.getRemainingTime()&&_this.screen.onend.update(void 0)},this.swipeDistanceThreshold=50,this.swipeAllowedTime=1e3,this.bindedAddTouchEvents=function(){},this.bindedRemoveTouchEvents=function(){},this.onTouchStart=function(e){_this.startPosition=bnt.Point.ofTouchEvent(e),_this.startTime=Date.now()},this.onMouseSwipeStart=function(e){_this.startPosition=bnt.Point.ofMouseSwipeEvent(e),_this.startTime=Date.now(),_this.setupMouseForSwipe(e)},this.onTouchMove=function(e){_this.adController.preventDefaultTouchEvents&&e.preventDefault()},this.onMouseSwipeMove=function(e){_this.adController.preventDefaultTouchEvents&&e.preventDefault()},this.onTouchEnd=function(e){var endPosition=bnt.Point.ofTouchEvent(e);_this.updateSwipe(endPosition,e)},this.onMouseSwipeEnd=function(e){var endPosition=bnt.Point.ofMouseSwipeEvent(e);_this.updateSwipe(endPosition,e),_this.resetMouseAfterSwipe(e)},this.onMouseClickForSwipe=function(e){_this.mouseSwiping&&e.stopImmediatePropagation()},this.onMouseClickForObserver=function(e){_this.screen.onclick.update(e)},bnt.get(bnt.StateChangeDetector).stateUpdated.addObserver(function(state){return _this.applyState(state)})}return ScreenRenderer.prototype.renderElement=function(renderer,screen,eos,state){renderer=bnt.ElementRendererRegistry.rendererFor(renderer);renderer.render(this.screenElement),renderer.configureForScreen(screen,eos)},ScreenRenderer.prototype.init=function(){var _this=this;bnt.logger.debug("SCREEN INIT"),this.screen.timeline=new bnt.ScreenTimeline(this),this.screen.forEachEos(function(eos,index,eosArr){var renderer=bnt.ElementRendererRegistry.rendererFor(eos.element);renderer.init(),eos.initZIndex(eosArr.length-index),renderer.configureForScreen(_this.screen,eos)}),this.screen.volume.addObserver(function(value){_this.screen.timeline.getElementsWithTimeline().map(function(element){return element.volume.update(value)})})},ScreenRenderer.prototype.load=function(){if(this.loaded)return bnt.Promise.fulfilledWith(null).future;this.loaded=!0;var futures=this.screen.eosMap(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).load()});return bnt.Promise.forAll(futures.concat(this.screen.customLoads))},ScreenRenderer.prototype.render=function(futures){var _this=this;if(bnt.logger.debug("render",this.screen),this.screenElement)return bnt.Promise.fulfilledWith(null).future;this.screenElement=bnt.createElement("div",futures),this.screenElement.id=this.screen.name,this.screenElement.hidden=!0,this.configureMe(this.state());futures=this.screen.eosMap(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).render(_this.screenElement)});return this.screen.getScenes(this.state()).filter(function(scene){return!scene.scrollDriven}).forEach(function(scene){_this.renderSceneStyle(scene)}),this.bindedAddTouchEvents=this.addTouchEvents.bind(this,this.screenElement),this.bindedRemoveTouchEvents=this.removeTouchEvents.bind(this,this.screenElement),bnt.Promise.forAll(futures)},ScreenRenderer.prototype.renderSceneStyle=function(scene){var animationSheet,className=bnt.getSceneClassName(this.screen,scene);document.getElementById(className)||((animationSheet=document.createElement("style")).id=className,animationSheet.innerHTML=bnt.getSceneStyle(this.screen,this.state(),scene),document.body.appendChild(animationSheet))},ScreenRenderer.prototype.showScreen=function(animationConfig){var _this=this;void 0===animationConfig&&(animationConfig=null),bnt.logger.debug("show",this.screen),this.currentAnimation.cancel(),this.screenElement.hidden=!1;var animation=bnt.Animation.of(this.screenElement,this.screenElement.id,bnt.lazyGet(bnt.State)().hash(),animationConfig);return this.currentAnimation=animation,this.screen.onshowAnimationStart.update(void 0),this.screen.timeline.getElementsWithTimeline().map(function(ewt){ewt.remainingTimeMillisec.addObserver(_this.updateRemainTimeClosure),ewt.duration.addObserver(_this.updateDurationClosure),ewt.timeMillisec.addObserver(_this.updateTimeClosure),ewt.onend.addObserver(_this.updateOnEndClosure)}),this.scrollController.scrollPercentage.addObserver(this.updateScrollClosure),void 0!==this.scrollController.previousScrollPercentage&&this.updateScrollClosure(this.scrollController.previousScrollPercentage),this.screen.eosMap(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).screenShowing(animation)}),animation.onComplete.onComplete(function(){_this.bindedAddTouchEvents(),_this.screen.onshow.update(void 0),_this.screen.onshowAnimationEnd.update(void 0)}),animation},ScreenRenderer.prototype.hideScreen=function(animationConfig){var _this=this;void 0===animationConfig&&(animationConfig=null),this.currentAnimation.cancel();var animation=bnt.Animation.of(this.screenElement,this.screenElement.id,bnt.lazyGet(bnt.State)().hash(),animationConfig);return this.currentAnimation=animation,this.screen.timeline.getElementsWithTimeline().map(function(ewt){ewt.remainingTimeMillisec.removeObserver(_this.updateRemainTimeClosure),ewt.duration.removeObserver(_this.updateDurationClosure),ewt.timeMillisec.removeObserver(_this.updateTimeClosure),ewt.onend.removeObserver(_this.updateOnEndClosure)}),this.scrollController.scrollPercentage.removeObserver(this.updateScrollClosure),this.bindedRemoveTouchEvents(),this.screen.onhide.update(void 0),this.screen.onhideAnimationStart.update(void 0),this.screen.eosMap(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).screenHiding(animation)}),this.bindedRemoveTouchEvents(),animation.onComplete.onComplete(function(){_this.screenElement.hidden=!0,_this.screen.onhideAnimationEnd.update(void 0)}),animation},ScreenRenderer.prototype.destroy=function(){var futures=this.screen.eosMap(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).destroy()});return this.bindedRemoveTouchEvents(),bnt.Promise.forAll(futures)},ScreenRenderer.prototype.updateSwipe=function(angle,e){var _this=this,angle=angle.minus(this.startPosition);Date.now()-this.startTime<=this.swipeAllowedTime&&angle.size()>=this.swipeDistanceThreshold?(-45<=(angle=180*angle.angle()/Math.PI)&&angle<=45?this.screen.onswiperight.update(void 0):45<=angle&&angle<=135?this.screen.onswipedown.update(void 0):angle<=-45&&-135<=angle?this.screen.onswipeup.update(void 0):(135<=angle||angle<=-135)&&this.screen.onswipeleft.update(void 0),this.mouseSwiping=!0,setTimeout(function(){_this.mouseSwiping=!1},1),e.stopPropagation()):this.mouseSwiping=!1},ScreenRenderer.prototype.setupMouseForSwipe=function(e){e.currentTarget.addEventListener("mousemove",this.onMouseSwipeMove),e.currentTarget.addEventListener("mouseup",this.onMouseSwipeEnd),e.currentTarget.addEventListener("mouseleave",this.onMouseSwipeEnd)},ScreenRenderer.prototype.resetMouseAfterSwipe=function(e){e.currentTarget.removeEventListener("mousemove",this.onMouseSwipeMove),e.currentTarget.removeEventListener("mouseup",this.onMouseSwipeEnd),e.currentTarget.removeEventListener("mouseleave",this.onMouseSwipeEnd)},ScreenRenderer.prototype.addTouchEvents=function(target){target.addEventListener("touchstart",this.onTouchStart),target.addEventListener("touchmove",this.onTouchMove),target.addEventListener("touchend",this.onTouchEnd),target.addEventListener("touchleave",this.onTouchEnd),target.addEventListener("mousedown",this.onMouseSwipeStart),target.addEventListener("click",this.onMouseClickForSwipe,!0),target.addEventListener("click",this.onMouseClickForObserver,!1)},ScreenRenderer.prototype.removeTouchEvents=function(target){target.removeEventListener("touchstart",this.onTouchStart),target.removeEventListener("touchmove",this.onTouchMove),target.removeEventListener("touchend",this.onTouchEnd),target.removeEventListener("touchleave",this.onTouchEnd),target.removeEventListener("mousedown",this.onMouseSwipeStart),target.removeEventListener("mousemove",this.onMouseSwipeMove),target.removeEventListener("mouseup",this.onMouseSwipeEnd),target.removeEventListener("mouseleave",this.onMouseSwipeEnd),target.removeEventListener("click",this.onMouseClickForSwipe,!0),target.removeEventListener("click",this.onMouseClickForObserver,!1)},ScreenRenderer.prototype.applyState=function(state){var _this=this,futures=[];return this.configureMe(state),this.screen.forEachEos(function(eosConfig){var renderer=bnt.ElementRendererRegistry.rendererFor(eosConfig.element),eosConfig=(eosConfig=renderer.screenConfigs.get(_this.screen)).getConfig(state);renderer.applyScreenConfig(state,eosConfig),futures.push(renderer.configure(state))}),bnt.Promise.forAll(futures)},ScreenRenderer.prototype.configureMe=function(state){this.screenElement&&bnt.style(this.screenElement,{overflow:"hidden",position:"absolute",top:bnt.px(0),left:bnt.px(0),width:bnt.px(state.canvas.config.width),height:bnt.px(state.canvas.config.height)})},ScreenRenderer}();bnt.ScreenRenderer=ScreenRenderer}(bnt=bnt||{}),function(bnt){var CreativeRenderer=function(){function CreativeRenderer(){this.document=document,this.renderersMap=new bnt.Map(new bnt.ScreenHash),this.rendered=!1,this.onstatechange=new bnt.Observable,bnt.set(CreativeRenderer,this),this.mainStage=new bnt.MainStage}return CreativeRenderer.prototype.init=function(){var bannerStage,_this=this;this.creative=bnt.get(bnt.Creative),this.mainStage.init(),this.creative.stages||(this.creative.stages=[]),this.creative.bannerScreen&&0==this.creative.stages.filter(function(stage){return stage.constructor==bnt.BannerStage}).length&&((bannerStage=new bnt.BannerStage).screen=this.creative.bannerScreen,bannerStage.canvases=this.creative.bannerCanvases,this.creative.stages.push(bannerStage)),this.creative.stages.forEach(function(stage){return stage.init()}),this.creative.timeline=new bnt.CreativeTimeline(this),this.creative.volume.addObserver(function(value){_this.creative.forEachScreen(function(screen){return screen.volume.update(value)})})},CreativeRenderer.prototype.load=function(){return bnt.Promise.forAll([this.mainStage.load()].concat(this.creative.stages.map(function(stage){return stage.load()})))},CreativeRenderer.prototype.render=function(target){return bnt.Promise.forAll([this.mainStage.render(target)].concat(this.creative.stages.map(function(stage){return stage.render(target)})))},CreativeRenderer.prototype.showCreative=function(){return bnt.Promise.forAll([this.mainStage.start()].concat(this.creative.stages.map(function(stage){return stage.start()})))},CreativeRenderer.prototype.onHideTransitionStart=function(){return bnt.Promise.fulfilledWith(void 0).future},CreativeRenderer.prototype.onHideTransitionComplete=function(){return bnt.Promise.fulfilledWith(void 0).future},CreativeRenderer.prototype.onShowTransitionStart=function(){return bnt.Promise.fulfilledWith(void 0).future},CreativeRenderer.prototype.onShowTransitionComplete=function(){return bnt.Promise.fulfilledWith(void 0).future},CreativeRenderer.prototype.destroyCreative=function(){return this.mainStage.destroyStage()},CreativeRenderer.prototype.switchTo=function(screenName,transition){return this.mainStage.switchTo(screenName,transition)},CreativeRenderer.prototype.playSceneAnimation=function(sceneId){return this.mainStage.playSceneAnimation(sceneId)},__decorate([bnt.Action({actionOf:bnt.Creative},"screen"),__metadata("design:type",Function),__metadata("design:paramtypes",[String,Object]),__metadata("design:returntype",Object)],CreativeRenderer.prototype,"switchTo",null),__decorate([bnt.Action({actionOf:bnt.Creative},"sceneAnimation"),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",Object)],CreativeRenderer.prototype,"playSceneAnimation",null),CreativeRenderer}();bnt.CreativeRenderer=CreativeRenderer}(bnt=bnt||{}),function(bnt){var ElementRenderer=function(){function ElementRenderer(element){var _this=this;this.element=element,this.screenConfigs=new bnt.Map(new bnt.ScreenHash),this.domElementReady=new bnt.Observable,this.listeners={},this.screenVisible=!1,this.shown=!1,this.lastAnimation=new bnt.DummyAnimation,this.state=bnt.lazyGet(bnt.State),this.onDomElementReady=function(){_this.element.onrender.update(void 0)},this.updateVisibleListener=function(v){if(null!=_this.lastEosConfig)return _this.updateVisible(!!_this.lastEosConfig[v?"onShow":"onHide"].name)},this.updateVisible=function(animated){var animation=_this.element.visible.value&&_this.screenVisible,needsShow=!_this.shown&&animation,needsHide=_this.shown&&!animation;if(needsShow||needsHide){_this.lastAnimation.cancel();animation=null;return needsShow&&(_this.shown=!0,_this.htmlElement.hidden=!1,animation=_this.doShowAnimation(animated)),needsHide&&(_this.shown=!1,(animation=_this.doHideAnimation(animated)).onAnimationPerformed.map(function(){_this.htmlElement.hidden=!0})),animation}return new bnt.DummyAnimation},this.domElementReady.addObserver(this.onDomElementReady)}return ElementRenderer.prototype.init=function(){var _this=this;this.domElementReady.addObserver(function(){return _this.registerBasicListeners()}),this.initImpl()},ElementRenderer.prototype.load=function(){return this.loadImpl()},ElementRenderer.prototype.initImpl=function(){},ElementRenderer.prototype.loadImpl=function(){return bnt.Promise.fulfilledWith(void 0).future},ElementRenderer.prototype.configureForScreen=function(screen,eos){this.screenConfigs.put(screen,eos)},ElementRenderer.prototype.createScreenTransition=function(fromScreen,toScreen,transition){var transitionSheet=document.createElement("style");transitionSheet.id=bnt.Animation.composeTransStyleId(fromScreen,transition.name,transition.duration||0,toScreen),transitionSheet.innerHTML+="\n"+bnt.Animation.createAnimForScreenTransition(toScreen,transition.in,transition.duration||0)+"\n"+bnt.Animation.createAnimForScreenTransition(fromScreen,transition.out,transition.duration||0),document.body.appendChild(transitionSheet)},ElementRenderer.prototype.render=function(target){var _this=this,sheet=document.createElement("style");return this.screenConfigs.forEach(function(screen,eos){eos.getConfigsCopy().forEach(function(state,config){sheet.innerHTML+=bnt.Animation.createAnimStyle(_this.element.elementId,state.hash(),config)}),screen.interactions&&screen.interactions.length&&screen.interactions.filter(function(interaction){return"switchTo"==interaction.action}).forEach(function(interaction){interaction.actionParameters[0]&&_this.createScreenTransition(screen.name,interaction.actionParameters[0].name,interaction.transition)}),eos.interactions&&eos.interactions.length&&eos.interactions.filter(function(interaction){return"switchTo"==interaction.action}).forEach(function(interaction){interaction.actionParameters[0]&&_this.createScreenTransition(screen.name,interaction.actionParameters[0].name,interaction.transition)})}),document.body.appendChild(sheet),this.elementRenderImpl(target).map(function(element){_this.htmlElement=_this.applyEffects(element),_this.positionDiv.id=_this.element.elementId,target.appendChild(_this.htmlElement),_this.htmlElement.hidden=!0,_this.element.hasOwnProperty("onclick")&&_this.element.onclick.hasObservers()&&(_this.htmlElement.style.cursor="pointer"),_this.element.visible.addObserver(_this.updateVisibleListener),_this.configure(_this.state())})},ElementRenderer.prototype.applyScreenConfig=function(state,config){this.lastState=state,this.lastEosConfig=config,this.positionDiv&&(bnt.style(this.positionDiv,{position:"absolute",left:bnt.px(config.x),top:bnt.px(config.y),zIndex:config.zIndex}),this.positionDiv.style["-webkit-transform"]="translateZ(0)")},ElementRenderer.prototype.configure=function(config){config=this.element.getConfig(config);return this.elementConfig=config,this.applyElementConfig(config)},ElementRenderer.prototype.doShowAnimation=function(animation){var _this=this,animation=animation?bnt.Animation.of(this.animationDiv,this.element.elementId,this.lastState.hash(),this.lastEosConfig&&this.lastEosConfig.onShow):new bnt.DummyAnimation;return this.lastAnimation=animation,this.element.onshowAnimationStart.update(void 0),this.htmlElement.classList.add("if-dummy-animated-hack-for-edge"),this.htmlElement.classList.remove("if-dummy-animated-hack-for-edge"),animation.onComplete.onComplete(function(){_this.element.onshowAnimationEnd.update(void 0)}),animation},ElementRenderer.prototype.doHideAnimation=function(animation){var _this=this,animation=animation?bnt.Animation.of(this.animationDiv,this.element.elementId,this.lastState.hash(),this.lastEosConfig&&this.lastEosConfig.onHide):new bnt.DummyAnimation;return this.lastAnimation=animation,this.element.onhideAnimationStart.update(void 0),animation.onComplete.onComplete(function(){_this.element.onhideAnimationEnd.update(void 0)}),animation},ElementRenderer.prototype.show=function(animated){return this.screenVisible=!0,this.updateVisible(animated)},ElementRenderer.prototype.hide=function(animated){return this.screenVisible=!1,this.updateVisible(animated)},ElementRenderer.prototype.screenShowing=function(animation){var _this=this;animation.onComplete.onComplete(function(){return _this.registerEventListenersImpl()})},ElementRenderer.prototype.screenHiding=function(animation){this.unregisterEventListenersImpl()},ElementRenderer.prototype.destroy=function(){return this.destroyImpl()},ElementRenderer.prototype.destroyImpl=function(){return this.element.visible.removeObserver(this.updateVisibleListener),this.domElementReady.removeObserver(this.onDomElementReady),this.unregisterEventListenersImpl(),this.elementDestroyImpl()},ElementRenderer.prototype.registerBasicListeners=function(){},ElementRenderer.prototype.registerFor=function(target,name,observable,stopPropagation,eventHandler,alwaysFire){void 0===stopPropagation&&(stopPropagation=!1),this.listeners[name]||!observable.hasObservers()&&!alwaysFire||(this.listeners[name]={},this.listeners[name].listener=eventHandler||function(e){stopPropagation&&e.stopPropagation(),observable.update(e)},(this.listeners[name].target=target).addEventListener(name,this.listeners[name].listener))},ElementRenderer.prototype.unregisterFor=function(target,name){this.listeners[name]&&(target.removeEventListener(name,this.listeners[name].listener),delete this.listeners[name])},ElementRenderer.prototype.unregisterAllFromElement=function(){var _this=this;Object.keys(this.listeners).forEach(function(eventName){_this.listeners[eventName].target.removeEventListener(eventName,_this.listeners[eventName].listener),delete _this.listeners[eventName]})},ElementRenderer.prototype.applyEffects=function(ret){ret=this.applyAnimations(ret);return ret=this.applyPosition(ret)},ElementRenderer.prototype.applyPosition=function(div){div=this.wrapDiv(div,"position");return this.positionDiv=div},ElementRenderer.prototype.applyAnimations=function(div){div=this.wrapDiv(div,"animation");return this.animationDiv=div},ElementRenderer.prototype.wrapDiv=function(element,aClass){var div=document.createElement("div");return div.classList.add(aClass),div.appendChild(element),div},ElementRenderer}();bnt.ElementRenderer=ElementRenderer}(bnt=bnt||{}),function(bnt){function DefaultCondition(element){return!0}function printElement(element){return bnt.fnName(element.constructor)+" id:"+element.id||JSON.stringify(element)}var ElementRendererRegistry=function(){function ElementRendererRegistry(){}return ElementRendererRegistry.registerRenderer=function(mapping,renderer,condition,priority){void 0===condition&&(condition=DefaultCondition),void 0===priority&&(priority=100),ElementRendererRegistry.registry.get(mapping)||ElementRendererRegistry.registry.put(mapping,new Array);mapping=ElementRendererRegistry.registry.get(mapping);mapping.push({renderer:renderer,condition:condition,priority:priority}),mapping.sort(function(a,b){return a.priority-b.priority})},ElementRendererRegistry.rendererFor=function(element){if(null!=(renderer=ElementRendererRegistry.renderer.get(element)))return renderer;var mappings=ElementRendererRegistry.registry.get(element.constructor);if(mappings){var possibleRenderers=mappings.filter(function(mapping){return mapping.condition(element)});if(0==possibleRenderers.length)throw new Error("no renderer matched for ".concat(printElement(element),"\n            options were: \n            ").concat(mappings.map(function(mapping){return bnt.fnName(mapping.renderer)}).join(",")));var renderer=new possibleRenderers[0].renderer(element);return ElementRendererRegistry.renderer.put(element,renderer),renderer}throw new Error("no renderer configured for "+printElement(element))},ElementRendererRegistry.registry=new bnt.Map(new bnt.FunctionHash),ElementRendererRegistry.renderer=new bnt.Map(new bnt.ElementHash),ElementRendererRegistry}();bnt.ElementRendererRegistry=ElementRendererRegistry}(bnt=bnt||{}),function(bnt){var Smooth=function(){function Smooth(threshold){this.threshold=threshold,this.speed=0,this.catchUpFactor=1}return Smooth.prototype.get=function(value){return null==this.lastValue&&(this.lastValue=value),this.speed=value-this.lastValue,Math.abs(this.speed)>this.threshold?this.lastValue=value:this.lastValue+=this.speed*this.catchUpFactor*(Math.abs(this.speed)/this.threshold),this.lastValue},Smooth}();bnt.Smooth=Smooth}(bnt=bnt||{}),function(bnt){var ScreenOrientationType;!function(ScreenOrientationType){ScreenOrientationType[ScreenOrientationType.Portrait=0]="Portrait",ScreenOrientationType[ScreenOrientationType.LandscapeLeft=1]="LandscapeLeft",ScreenOrientationType[ScreenOrientationType.LandscapeRight=2]="LandscapeRight",ScreenOrientationType[ScreenOrientationType.PortraitReverse=3]="PortraitReverse"}(ScreenOrientationType=bnt.ScreenOrientationType||(bnt.ScreenOrientationType={}));var ScreenOrientation=function(){function ScreenOrientation(){}return ScreenOrientation.is=function(screenOrientation){return ScreenOrientation.get()==screenOrientation},Object.defineProperty(ScreenOrientation,"isLandscape",{get:function(){var o=ScreenOrientation.get();return o==ScreenOrientationType.LandscapeLeft||o==ScreenOrientationType.LandscapeRight},enumerable:!1,configurable:!0}),Object.defineProperty(ScreenOrientation,"isPortrait",{get:function(){var o=ScreenOrientation.get();return o==ScreenOrientationType.Portrait||o==ScreenOrientationType.PortraitReverse},enumerable:!1,configurable:!0}),ScreenOrientation.get=function(){var screenOrientation,w=window;if(w&&w.screen&&w.screen.orientation&&"number"==typeof w.screen.orientation.angle)switch(w.screen.orientation.angle){case 0:screenOrientation=ScreenOrientationType.Portrait;break;case 90:screenOrientation=ScreenOrientationType.LandscapeLeft;break;case 180:screenOrientation=ScreenOrientationType.PortraitReverse;break;case 270:screenOrientation=ScreenOrientationType.LandscapeRight;break;default:screenOrientation=ScreenOrientation.getInaccurateOrientation()}else{if("number"!=typeof w.orientation)return ScreenOrientation.getInaccurateOrientation();switch(w.orientation){case 0:screenOrientation=ScreenOrientationType.Portrait;break;case 90:screenOrientation=ScreenOrientationType.LandscapeLeft;break;case 180:screenOrientation=ScreenOrientationType.PortraitReverse;break;case-90:screenOrientation=ScreenOrientationType.LandscapeRight;break;default:return ScreenOrientation.getInaccurateOrientation()}}return screenOrientation=ScreenOrientation.sanityCheck(screenOrientation)},ScreenOrientation.getInaccurateOrientation=function(){function get(w){return w.innerWidth>w.innerHeight?ScreenOrientationType.LandscapeLeft:ScreenOrientationType.Portrait}try{return get(window.top||window)}catch(e){return get(window)}},ScreenOrientation.sanityCheck=function(screenOrientation){var inaccurateOrientation=ScreenOrientation.getInaccurateOrientation();return inaccurateOrientation==ScreenOrientationType.Portrait&&(screenOrientation==ScreenOrientationType.LandscapeLeft||screenOrientation==ScreenOrientationType.LandscapeRight)||inaccurateOrientation==ScreenOrientationType.LandscapeLeft&&(screenOrientation==ScreenOrientationType.Portrait||screenOrientation==ScreenOrientationType.PortraitReverse)?inaccurateOrientation:screenOrientation},ScreenOrientation}();bnt.ScreenOrientation=ScreenOrientation}(bnt=bnt||{}),function(bnt){var TextBoxRenderer=function(_super){function TextBoxRenderer(textbox){var _this=_super.call(this,textbox)||this;return _this.textbox=textbox,_this}return __extends(TextBoxRenderer,_super),TextBoxRenderer.prototype.elementRenderImpl=function(target){return this.textboxElement=document.createElement("div"),this.domElementReady.update(void 0),bnt.Promise.fulfilledWith(this.textboxElement).future},TextBoxRenderer.prototype.elementDestroyImpl=function(){return this.textboxElement&&this.textboxElement.parentNode&&this.textboxElement.parentNode.removeChild(this.textboxElement),bnt.Promise.fulfilledWith(this.textboxElement).future},TextBoxRenderer.prototype.applyElementConfig=function(config){return config.visible!=this.element.visible.value&&this.element.visible.update(config.visible),this.textboxElement&&(this.textboxElement.innerText=config.text,bnt.style(this.textboxElement,__assign({width:bnt.px(config.width),height:bnt.px(config.height),wordBreak:"keep-all",overflow:"hidden",transform:"rotate("+config.angle+"deg)",opacity:config.opacity},bnt.computeTextElementStyle(config)))),bnt.Promise.fulfilledWith(!0).future},TextBoxRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.textboxElement,"click",this.textbox.onclick,!0),this.registerFor(this.textboxElement,"mouseenter",this.textbox.onmouseenter),this.registerFor(this.textboxElement,"mouseleave",this.textbox.onmouseleave)},TextBoxRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.textboxElement,"click"),this.unregisterFor(this.textboxElement,"mouseenter"),this.unregisterFor(this.textboxElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.TextBox),__metadata("design:paramtypes",[bnt.TextBox])],TextBoxRenderer)}(bnt.ElementRenderer);bnt.TextBoxRenderer=TextBoxRenderer}(bnt=bnt||{}),function(bnt){var SubtitleRenderer=function(_super){function SubtitleRenderer(subtitle){var _this=_super.call(this,subtitle)||this;return _this.subtitle=subtitle,_this.time=0,_this.actions=null,_this}return __extends(SubtitleRenderer,_super),SubtitleRenderer.prototype.elementRenderImpl=function(target){return this.subtitleElement=document.createElement("div"),this.domElementReady.update(void 0),bnt.Promise.fulfilledWith(this.subtitleElement).future},SubtitleRenderer.prototype.elementDestroyImpl=function(){return this.subtitleElement&&this.subtitleElement.parentNode&&this.subtitleElement.parentNode.removeChild(this.subtitleElement),bnt.Promise.fulfilledWith(this.subtitleElement).future},SubtitleRenderer.prototype.applyElementConfig=function(config){var currentSrc,_this=this,targetVideo=config.targetVideo;return this.videoElement=targetVideo?targetVideo.timeline.videoRenderer.videoElement:null,this.videoElement&&this.subtitleElement?(currentSrc=targetVideo.getConfig(bnt.get(bnt.State)).src,this.oldVideoSrc!=currentSrc&&(this.actions=[].concat(config.subtitleActions),this.subtitleElement.innerHTML="",this.oldVideoSrc=currentSrc),targetVideo.onplay.addEventListener(function(){!_this.interval&&0<_this.actions.length&&_this.createInterval(config,targetVideo),_this.element.visible.value||_this.element.visible.update(!0)}),this.videoElement.addEventListener("play",function(){!_this.interval&&0<_this.actions.length&&_this.createInterval(config,targetVideo)}),this.videoElement.addEventListener("pause",function(){0<_this.videoElement.currentTime&&!_this.interval&&_this.createInterval(config,targetVideo),_this.videoElement.currentTime==_this.videoElement.duration?(bnt.cancelAnimFrame(_this.interval),_this.actions=[].concat(config.subtitleActions),_this.time=0,_this.interval=null,_this.subtitleElement.innerHTML=""):(bnt.cancelAnimFrame(_this.interval),_this.interval=null)})):console.warn("Subtitle doesn't have a valid video selected"),bnt.style(this.subtitleElement,__assign({width:bnt.px(config.width),height:bnt.px(config.height),wordBreak:"keep-all",overflow:"hidden",transform:"rotate("+config.angle+"deg)",opacity:config.opacity,cursor:"default",visibility:"hidden"},bnt.computeTextElementStyle(config))),bnt.Promise.fulfilledWith(!0).future},SubtitleRenderer.prototype.smallDifference=function(current,target){return target<current||Math.abs(target-current)<.1},SubtitleRenderer.prototype.createInterval=function(config,targetVideo){var _this=this,loop=function(){if(_this.interval=bnt.requestAnimFrame(loop),_this.time=_this.videoElement.currentTime||targetVideo.timeMillisec.value,config.visibleOnMute&&_this.element.visible.update(!targetVideo.volume.value),0<_this.actions.length&&_this.smallDifference(_this.time,_this.actions[0].time/1e3)){var doNow=_this.actions[0];switch(doNow.action){case"show":_this.subtitleElement.innerHTML=doNow.data,bnt.style(_this.subtitleElement,{visibility:"visible"});break;case"hide":bnt.style(_this.subtitleElement,{visibility:"hidden"}),_this.subtitleElement.innerHTML=""}_this.actions.shift()}};loop()},SubtitleRenderer.prototype.registerEventListenersImpl=function(){},SubtitleRenderer.prototype.unregisterEventListenersImpl=function(){},__decorate([bnt.RendererOf(bnt.Subtitle),__metadata("design:paramtypes",[bnt.Subtitle])],SubtitleRenderer)}(bnt.ElementRenderer);bnt.SubtitleRenderer=SubtitleRenderer}(bnt=bnt||{}),function(bnt){var HtmlBoxRenderer=function(_super){function HtmlBoxRenderer(htmlBox){var _this=_super.call(this,htmlBox)||this;return _this.htmlBox=htmlBox,_this}return __extends(HtmlBoxRenderer,_super),HtmlBoxRenderer.prototype.elementRenderImpl=function(target){return this.htmlBoxElement=document.createElement("div"),this.htmlBoxElement.innerHTML=decodeURIComponent(this.element.htmlCode)||"",this.domElementReady.update(void 0),bnt.Promise.fulfilledWith(this.htmlBoxElement).future},HtmlBoxRenderer.prototype.elementDestroyImpl=function(){return this.htmlBoxElement&&this.htmlBoxElement.parentNode&&this.htmlBoxElement.parentNode.removeChild(this.htmlBoxElement),bnt.Promise.fulfilledWith(this.htmlBoxElement).future},HtmlBoxRenderer.prototype.applyElementConfig=function(config){return config.visible!=this.element.visible.value&&this.element.visible.update(config.visible),this.htmlBoxElement&&bnt.style(this.htmlBoxElement,{width:bnt.px(config.width),height:bnt.px(config.height),overflow:"hidden",transform:"rotate("+(config.angle||0)+"deg)"}),bnt.Promise.fulfilledWith(null).future},HtmlBoxRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.htmlBoxElement,"click",this.htmlBox.onclick,!0),this.registerFor(this.htmlBoxElement,"mouseenter",this.htmlBox.onmouseenter),this.registerFor(this.htmlBoxElement,"mouseleave",this.htmlBox.onmouseleave)},HtmlBoxRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.htmlBoxElement,"click"),this.unregisterFor(this.htmlBoxElement,"mouseenter"),this.unregisterFor(this.htmlBoxElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.HtmlBox),__metadata("design:paramtypes",[bnt.HtmlBox])],HtmlBoxRenderer)}(bnt.ElementRenderer);bnt.HtmlBoxRenderer=HtmlBoxRenderer}(bnt=bnt||{}),function(bnt){var ShapeRenderer=function(_super){function ShapeRenderer(shape){var _this=_super.call(this,shape)||this;return _this.shape=shape,_this}return __extends(ShapeRenderer,_super),ShapeRenderer.prototype.elementRenderImpl=function(target){return this.divElement=document.createElement("div"),this.domElementReady.update(void 0),bnt.Promise.fulfilledWith(this.divElement).future},ShapeRenderer.prototype.elementDestroyImpl=function(){return this.divElement&&this.divElement.parentNode&&this.divElement.parentNode.removeChild(this.divElement),bnt.Promise.fulfilledWith(this.divElement).future},ShapeRenderer.prototype.applyElementConfig=function(config){return config.visible!=this.element.visible.value&&this.element.visible.update(config.visible),this.divElement&&bnt.style(this.divElement,{width:bnt.px(config.width),height:bnt.px(config.height),borderRadius:bnt.px(config.radius),backgroundColor:config.backgroundColor,border:bnt.px(config.border)+" solid "+config.borderColor,transform:"rotate("+config.angle+"deg)",opacity:config.opacity,boxSizing:"border-box"}),bnt.Promise.fulfilledWith(null).future},ShapeRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.divElement,"click",this.shape.onclick,!0),this.registerFor(this.divElement,"mouseenter",this.shape.onmouseenter),this.registerFor(this.divElement,"mouseleave",this.shape.onmouseleave)},ShapeRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.divElement,"click"),this.unregisterFor(this.divElement,"mouseenter"),this.unregisterFor(this.divElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.Shape),__metadata("design:paramtypes",[bnt.Shape])],ShapeRenderer)}(bnt.ElementRenderer);bnt.ShapeRenderer=ShapeRenderer}(bnt=bnt||{}),function(bnt){var HotspotRenderer=function(_super){function HotspotRenderer(hotspot){var _this=_super.call(this,hotspot)||this;return _this.hotspot=hotspot,_this}return __extends(HotspotRenderer,_super),HotspotRenderer.prototype.elementRenderImpl=function(target){return this.divElement=document.createElement("div"),this.domElementReady.update(void 0),bnt.Promise.fulfilledWith(this.divElement).future},HotspotRenderer.prototype.elementDestroyImpl=function(){return this.divElement&&this.divElement.parentNode&&this.divElement.parentNode.removeChild(this.divElement),bnt.Promise.fulfilledWith(this.divElement).future},HotspotRenderer.prototype.applyElementConfig=function(config){return config.visible!=this.element.visible.value&&this.element.visible.update(config.visible),this.divElement&&bnt.style(this.divElement,{width:bnt.px(config.width),height:bnt.px(config.height),borderRadius:bnt.px(config.radius),transform:"rotate("+config.angle+"deg)",boxSizing:"border-box",webkitTapHighlightColor:"rgba(0, 0, 0, 0)"}),bnt.Promise.fulfilledWith(null).future},HotspotRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.divElement,"click",this.hotspot.onclick,!0),this.registerFor(this.divElement,"mouseenter",this.hotspot.onmouseenter),this.registerFor(this.divElement,"mouseleave",this.hotspot.onmouseleave)},HotspotRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.divElement,"click"),this.unregisterFor(this.divElement,"mouseenter"),this.unregisterFor(this.divElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.Hotspot),__metadata("design:paramtypes",[bnt.Hotspot])],HotspotRenderer)}(bnt.ElementRenderer);bnt.HotspotRenderer=HotspotRenderer}(bnt=bnt||{}),function(bnt){var BaseVideoRenderer=function(_super){function BaseVideoRenderer(config){var _this=_super.call(this,config)||this;_this.video=config,_this.videoHasEverPlayed=!1;config=config.getConfig(bnt.get(bnt.State));return bnt.isVast(config.src)&&bnt.extendInstance(_this,[bnt.VastAdaptor]),_this}return __extends(BaseVideoRenderer,_super),BaseVideoRenderer.prototype.preloadAssets=function(){},BaseVideoRenderer.prototype.initImpl=function(){this.video.timeline=new bnt.VideoTimeline(this)},BaseVideoRenderer.prototype.loadImpl=function(){return this.preloadAssets(),bnt.Promise.fulfilledWith(null).future},BaseVideoRenderer.prototype.populateElements=function(target){throw new Error("The required method `populateElements` was not implemented.")},BaseVideoRenderer.prototype.loadVideoSrc=function(){var config=bnt.get(bnt.State),config=this.video.getConfig(config);this.videoElement&&bnt.formatProtocol(this.videoElement.src)!=bnt.getSrc(config.src)&&(this.videoElement.src=bnt.getSrc(config.src),this.isVideoUrlOptimized(this.videoElement.src)||bnt.LIBRARY[bnt.extractAssetId(config.src)].external||bnt.sumo({e:"unoptimizedMedia2"}))},BaseVideoRenderer.prototype.isVideoUrlOptimized=function(videoSrc){return/\.(high|low)\.mp4/.test(videoSrc)},BaseVideoRenderer.prototype.loadCoverSrc=function(){var config=bnt.get(bnt.State),config=this.video.getConfig(config);bnt.setSrc(this.coverElement,config.cover,config.width),bnt.setupWebkitResponsiveImageFix(this.coverElement)},BaseVideoRenderer.prototype.elementRenderImpl=function(config){var _this=this;this.populateElements(config),bnt.style(this.coverElement,{width:"0",height:"0",zIndex:"5"}),this.videoElement.controls=!0,this.videoElement.controls=!1;config=bnt.get(bnt.State),config=this.video.getConfig(config);return config.cover&&!config.autoplay?this.coverElement.hidden=!1:this.coverElement.hidden=!0,this.video.onplay.addEventListener(function(){_this.coverElement.hidden=!0,_this.videoHasEverPlayed=!0}),this.bindedHandlerCoverClick=this.handlerCoverClick.bind(this),this.coverElement.addEventListener("click",this.bindedHandlerCoverClick),config.autoplay?this.video.play():this.video.timeline.play().map(function(){return _this.video.timeline.stop()}),bnt.Promise.fulfilledWith(this.containerElement).future},BaseVideoRenderer.prototype.handlerCoverClick=function(e){e.stopPropagation(),this.coverElement.removeEventListener("click",this.bindedHandlerCoverClick),this.video.play()},BaseVideoRenderer.prototype.show=function(animated){return this.video.resume().onComplete(function(_){return _}),_super.prototype.show.call(this,animated)},BaseVideoRenderer.prototype.hide=function(a){var _this=this,a=_super.prototype.hide.call(this,a);return a.onComplete.map(function(){return _this.video.suspend()}),a},BaseVideoRenderer.prototype.elementDestroyImpl=function(){return bnt.Promise.fulfilledWith(null).future},BaseVideoRenderer.prototype.applyElementConfig=function(config){return config.visible!=this.element.visible.value&&this.element.visible.update(config.visible),this.applyElementConfigImpl(config)},BaseVideoRenderer.prototype.applyElementConfigImpl=function(config){var videoIsChanging=!1;return this.videoElement&&(videoIsChanging=bnt.formatProtocol(this.videoElement.src)!=bnt.getSrc(config.src)),this.containerElement&&(this.containerElement.style.width=bnt.px(config.width),this.containerElement.style.height=bnt.px(config.height),this.containerElement.style.opacity=String(config.opacity),this.containerElement.style.transform="rotate("+(config.angle||0)+"deg)"),this.coverElement&&(this.coverElement.style.border="0",this.coverElement.style.position="absolute",this.coverElement.style.left="0",this.coverElement.style.top="0",this.coverElement.style.width=bnt.px(config.width),this.coverElement.style.height=bnt.px(config.height),videoIsChanging&&(this.coverElement.hidden=!config.cover||config.autoplay)),this.loadVideoSrc(),this.loadCoverSrc(),this.screenVisible&&config.autoplay&&(this.videoHasEverPlayed&&!videoIsChanging||this.video.play()),bnt.Promise.fulfilledWith(void 0).future},BaseVideoRenderer.prototype.registerBasicListeners=function(){var _this=this;this.registerFor(this.videoElement,"ended",this.video.onend,!1,function(){return _this.video.onend.update(void 0)},!0),this.registerFor(this.videoElement,"durationchange",this.video.duration,!1,function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];return setTimeout(function(){return!isNaN(_this.videoElement.duration)&&_this.video.duration.update(_this.videoElement.duration)},1)},!0),this.registerFor(this.videoElement,"timeupdate",this.video.timeMillisec,!1,function(){for(var t,rt,args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];isNaN(_this.videoElement.duration)||(t=_this.videoElement.currentTime,isNaN(t)&&(t=0),(rt=_this.videoElement.duration-t)<0&&(rt=0),_this.video.timeMillisec.update(t),_this.video.time.value!=Math.floor(t)&&_this.video.time.update(Math.floor(t)),_this.video.remainingTimeMillisec.update(rt),_this.video.remainingTime.value!=Math.floor(rt)&&_this.video.remainingTime.update(Math.floor(rt)))},!0),this.video.volume.addObserver(function(value){_this.volume=value,_this.videoElement.volume=value,_this.videoElement.muted=!value})},BaseVideoRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.getClickTarget(),"click",this.video.onclick,!0),this.registerFor(this.containerElement,"mouseenter",this.video.onmouseenter),this.registerFor(this.containerElement,"mouseleave",this.video.onmouseleave)},BaseVideoRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.getClickTarget(),"click"),this.unregisterFor(this.containerElement,"mouseenter"),this.unregisterFor(this.containerElement,"mouseleave")},BaseVideoRenderer.prototype.getClickTarget=function(){return this.videoElement},BaseVideoRenderer}(bnt.ElementRenderer);bnt.BaseVideoRenderer=BaseVideoRenderer}(bnt=bnt||{}),function(bnt){var WithPan=function(_super){function WithPan(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(WithPan,_super),WithPan.prototype.getVideoElementWithPan=function(){return this.videoElementWithPan},WithPan.prototype.elementRenderImpl=function(f){var _this=this,f=_super.prototype.elementRenderImpl.call(this,f);return this.videoElementWithPan=new bnt.ElementWithPan({container:{element:this.containerElement,width:function(c){return c.width},height:function(c){return c.height}},element:{element:this.videoElement,width:function(c){return c.videoWidth},height:function(c){return c.videoHeight}}}),this.videoElementWithPan.onSizesChange.addObserver(function(sizes){sizes&&_this.videoElement&&(_this.videoElement.hidden=!1,bnt.style(_this.videoElement,{position:"absolute",left:bnt.px(sizes.x),top:bnt.px(sizes.y),width:"100%",height:"100%",aspectRatio:"auto"}))}),this.coverElementWithPan=new bnt.ElementWithPan({container:{element:this.containerElement,width:function(c){return c.width},height:function(c){return c.height}},element:{element:this.coverElement,width:function(c){return c.coverWidth},height:function(c){return c.coverHeight}}}),this.coverElementWithPan.onSizesChange.addObserver(function(sizes){sizes&&_this.coverElement&&(bnt.setSizes(_this.coverElement,bnt.getSizes(sizes.w)),bnt.style(_this.coverElement,{position:"absolute",left:bnt.px(sizes.x),top:bnt.px(sizes.y),border:"0",width:"100%",height:"100%"}))}),this.enablePanForCorrectElement(),f},WithPan.prototype.enablePanForCorrectElement=function(){var vConfig;this.videoElementWithPan&&this.coverElementWithPan&&(vConfig=bnt.get(bnt.State),vConfig=this.video.getConfig(vConfig),this.videoElementWithPan.disable(),this.coverElementWithPan.disable(),vConfig.panActive&&(vConfig.cover&&!vConfig.autoplay?this.coverElementWithPan:this.videoElementWithPan).enable())},WithPan.prototype.registerEventListenersImpl=function(){_super.prototype.registerEventListenersImpl.call(this),this.videoElementWithPan&&this.videoElementWithPan.registerListeners(),this.coverElementWithPan&&this.coverElementWithPan.registerListeners()},WithPan.prototype.unregisterEventListenersImpl=function(){_super.prototype.unregisterEventListenersImpl.call(this),this.videoElementWithPan&&this.videoElementWithPan.unregisterListeners(),this.coverElementWithPan&&this.coverElementWithPan.unregisterListeners()},WithPan.prototype.handlerCoverClick=function(state){_super.prototype.handlerCoverClick.call(this,state);state=bnt.get(bnt.State);this.video.getConfig(state).panActive&&(this.coverElementWithPan.disable(),this.videoElementWithPan.enable())},WithPan.prototype.applyElementConfigImpl=function(config){return _super.prototype.applyElementConfigImpl.call(this,config),this.lastConfig=config,this.containerElement&&bnt.style(this.containerElement,{width:bnt.px(config.width),height:bnt.px(config.height),overflow:"hidden",position:"relative"}),this.videoElementWithPan&&this.videoElementWithPan.updateConfig(config),this.coverElementWithPan&&this.coverElementWithPan.updateConfig(config),this.enablePanForCorrectElement(),bnt.Promise.fulfilledWith(null).future},WithPan}(bnt.BaseVideoRenderer);bnt.WithPan=WithPan}(bnt=bnt||{}),function(bnt){var ElementWithPan=function(){function ElementWithPan(options){var _this=this;this.options=options,this.gyroLocked=!1,this.pointerHasMoved=!1,this.pointerAfterSpeed=bnt.Point.zero,this.elementPosition=bnt.Point.zero,this.sizes={w:0,h:0,x:0,y:0,side:bnt.SIDE.NONE},this.enabled=!0,this.onSizesChange=new bnt.ObservableValue(null),this.resettingToCenter={active:!1,startPosition:null,percentageDone:null,speed:bnt.Point.from(7.5)},this.touchstart=function(e){_this.pointerEventsEnabled&&(_this.gyroLocked=!0,_this.pointerHasMoved=!1,_this.pointerPosition=new bnt.Point(e.touches[0].clientX,e.touches[0].clientY),_this.pointerAfterSpeed=bnt.Point.zero)},this.touchmove=function(e){_this.pointerEventsEnabled&&_this.gyroLocked&&(_this.pointerHasMoved=!0,_this.pointerPosition=new bnt.Point(e.touches[0].clientX,e.touches[0].clientY))},this.mousedown=function(e){_this.pointerEventsEnabled&&(_this.gyroLocked=!0,_this.pointerHasMoved=!1,_this.pointerPosition=new bnt.Point(e.clientX,e.clientY),_this.pointerAfterSpeed=bnt.Point.zero)},this.mousemove=function(e){_this.pointerEventsEnabled&&_this.gyroLocked&&((null!=e.buttons&&e.buttons%2==0||e.button)&&(_this.pointerAfterSpeed=bnt.Point.zero,_this.pointerout.call(_this)),_this.pointerHasMoved=!0,_this.pointerPosition=new bnt.Point(e.clientX,e.clientY))},this.pointerout=function(){_this.pointerEventsEnabled&&(_this.gyroLocked=!1,_this.pointerLastPosition=null)},this.click=function(e){_this.pointerHasMoved&&e.stopPropagation()},this.dragstart=function(e){e.preventDefault()},this.contextmenu=function(e){e.preventDefault()},this.autoenable=!0,ElementWithPan.init(),ElementWithPan.registerElement(this),this.smoothAlpha=new bnt.Smooth(20),this.smoothBeta=new bnt.Smooth(20),this.smoothGamma=new bnt.Smooth(20),this.addViewportInidicator()}return ElementWithPan.init=function(){ElementWithPan.inited||(ElementWithPan.inited=!0,ElementWithPan.initViewportStyle(),ElementWithPan.update())},ElementWithPan.initViewportStyle=function(){var viewportIndicatorSize=25*(devicePixelRatio?ElementWithPan.clamp(devicePixelRatio,0,2):1);bnt.createElement("style",document.body).innerHTML="\n        .bnt-viewport-indicator {\n          width: ".concat(bnt.px(viewportIndicatorSize),";\n          height: ").concat(bnt.px(viewportIndicatorSize),";\n          position: absolute;\n          right: 10px;\n          top: 50%;\n          transform: translateY(-50%) translateZ(0);\n          border-radius: 50%;\n          background: ").concat("rgba(0, 0, 0, .5)",';\n          z-index: 6;\n        }\n        .bnt-viewport-indicator:before {\n          content: "";\n          width: ').concat(bnt.px(.85*viewportIndicatorSize),";\n          height: ").concat(bnt.px(.85*viewportIndicatorSize),";\n          border: 1px solid ").concat("rgba(255, 255, 255, 0.9)",';\n          position: absolute;\n          left: 50%;\n          top: 50%;\n          transform: translate(-50%, -50%);\n          border-radius: inherit;\n        }\n        .bnt-viewport-indicator:after {\n          content: "";\n          width: ').concat(bnt.px(.1*viewportIndicatorSize),";\n          height: ").concat(bnt.px(.1*viewportIndicatorSize),";\n          background: ").concat("rgba(255, 255, 255, 0.9)",";\n          position: absolute;\n          left: 50%;\n          top: 50%;\n          transform: translate(-50%, -50%);\n          border-radius: inherit;\n        }\n        .bnt-viewport-indicator .bnt-indicator {\n          width: 0;\n          height: 0;\n          position: absolute;\n          left: 50%;\n          top: 50%;\n          transform: translate(-50%, -50%) rotate(0deg);\n        }\n        .bnt-viewport-indicator .bnt-indicator .bnt-indicator-inner {\n          width: ").concat(bnt.px(viewportIndicatorSize),";\n          height: ").concat(bnt.px(.3*viewportIndicatorSize),";\n          position: absolute;\n          left: 50%;\n          bottom: ").concat(bnt.px(.1*viewportIndicatorSize),';\n          transform: translateX(-50%);\n          overflow: hidden;\n        }\n        .bnt-viewport-indicator .bnt-indicator .bnt-indicator-inner:after {\n          content: "";\n          width: 0;\n          height: 0;\n          border-top: ').concat(bnt.px(.4*viewportIndicatorSize)," solid ").concat("rgba(255, 255, 255, 0.9)",";\n          border-left: ").concat(bnt.px(viewportIndicatorSize/4)," solid transparent;\n          border-right: ").concat(bnt.px(viewportIndicatorSize/4)," solid transparent;\n          position: absolute;\n          left: 50%;\n          top: ").concat(bnt.px(.025*viewportIndicatorSize),";\n          transform: translateX(-50%);\n          border-radius: 100% 100% 0 0;\n        }\n        \n        .bnt-viewport-indicator .bnt-indicator.bnt-indicator-shadow .bnt-indicator-inner:after {\n          border-top-color: ").concat("rgba(255, 255, 255, 0.1)",";\n        }\n      ")},ElementWithPan.update=function(){bnt.requestAnimFrame(ElementWithPan.update);var dt=ElementWithPan.getDeltaTime;ElementWithPan.elements.forEach(function(el){return el.update(dt)})},ElementWithPan.registerElement=function(el){ElementWithPan.elements.push(el)},Object.defineProperty(ElementWithPan,"getDeltaTime",{get:function(){var ts=Date.now();ElementWithPan.lsts||(ElementWithPan.lsts=ts);var dt=(ts-ElementWithPan.lsts)/1e3;return ElementWithPan.lsts=ts,dt},enumerable:!1,configurable:!0}),Object.defineProperty(ElementWithPan.prototype,"pointerDown",{get:function(){return this.gyroLocked},enumerable:!1,configurable:!0}),ElementWithPan.prototype.addViewportInidicator=function(){var _this=this;this.indicatorWrap=bnt.createElement("div",this.options.container.element),this.indicatorWrap.classList.add("bnt-viewport-indicator"),this.indicatorWrap.addEventListener("click",function(e){_this.resettingToCenter.startPosition=_this.elementPosition.clone(),_this.resettingToCenter.percentageDone=bnt.Point.zero,_this.resettingToCenter.active=!0,e.stopPropagation()}),this.indicator=bnt.createElement("div",this.indicatorWrap),this.indicator.classList.add("bnt-indicator"),bnt.createElement("div",this.indicator).classList.add("bnt-indicator-inner");var helperElement4=bnt.createElement("div",this.indicatorWrap);helperElement4.classList.add("bnt-indicator"),helperElement4.classList.add("bnt-indicator-shadow");helperElement4=bnt.createElement("div",helperElement4);helperElement4.classList.add("bnt-indicator-inner"),helperElement4.classList.add("bnt-indicator-inner")},Object.defineProperty(ElementWithPan.prototype,"pointerEventsEnabled",{get:function(){return this.config&&this.config.panActive&&this.config.usePointer||!this.config},enumerable:!1,configurable:!0}),Object.defineProperty(ElementWithPan.prototype,"gyroscopeEnabled",{get:function(){return this.config&&this.config.panActive&&this.config.useGyroscope||!this.config},enumerable:!1,configurable:!0}),ElementWithPan.prototype.registerListeners=function(){var _this=this;this.options.container.element.addEventListener("touchstart",this.touchstart,!0),this.options.container.element.addEventListener("touchmove",this.touchmove,!0),this.options.container.element.addEventListener("touchend",this.pointerout,!0),this.options.container.element.addEventListener("touchleave",this.pointerout,!0),this.options.container.element.addEventListener("mousedown",this.mousedown,!0),this.options.container.element.addEventListener("mousemove",this.mousemove,!0),this.options.container.element.addEventListener("mouseup",this.pointerout,!0),this.options.container.element.addEventListener("click",this.click,!0),this.options.container.element.addEventListener("dragstart",this.dragstart,!0),this.options.element.element.addEventListener("dragstart",this.dragstart,!0),this.options.element.element.addEventListener("contextmenu",this.contextmenu,!0),this.subDeviceOrientation=bnt.DeviceOrientation.subscribe(function(rotation){rotation.continuous={alpha:_this.smoothAlpha.get(rotation.continuous.alpha),beta:_this.smoothBeta.get(rotation.continuous.beta),gamma:_this.smoothGamma.get(rotation.continuous.gamma)},_this.deviceLastRotation||(_this.deviceLastRotation=rotation.continuous),bnt.ScreenOrientation.get()!=_this.currentOrientation&&(_this.deviceLastRotation=rotation.continuous,_this.currentOrientation=bnt.ScreenOrientation.get()),_this.deviceRotation=rotation.continuous})},ElementWithPan.prototype.unregisterListeners=function(){this.options.container.element.removeEventListener("touchstart",this.touchstart,!0),this.options.container.element.removeEventListener("touchmove",this.touchmove,!0),this.options.container.element.removeEventListener("touchend",this.pointerout,!0),this.options.container.element.removeEventListener("touchleave",this.pointerout,!0),this.options.container.element.removeEventListener("mousedown",this.mousedown,!0),this.options.container.element.removeEventListener("mousemove",this.mousemove,!0),this.options.container.element.removeEventListener("mouseup",this.pointerout,!0),this.options.container.element.removeEventListener("click",this.click,!0),this.options.container.element.removeEventListener("dragstart",this.dragstart,!0),this.options.element.element.removeEventListener("dragstart",this.dragstart,!0),this.options.element.element.removeEventListener("contextmenu",this.contextmenu,!0),this.subDeviceOrientation&&this.subDeviceOrientation.unsubscribe()},ElementWithPan.prototype.update=function(dt){var _c,_a,x,y;this.enabled&&(x=(_a=__read(this.updateWithPointerAfterMovement([x=0,y=0,dt]),2))[0],y=_a[1],y=this.gyroLocked?(x=(_c=__read(this.updateWithPointerMovement([x,y]),2))[0],_c[1]):(x=(_c=__read(this.updateWithGyroMovement([x,y]),2))[0],_c[1]),this.updateGyroLastRotations(),this.resettingToCenter.active&&this.resetToCenter(dt),x=ElementWithPan.clampAbs(this.elementPosition.x+x,Math.abs(this.sizes.x)),y=ElementWithPan.clampAbs(this.elementPosition.y+y,Math.abs(this.sizes.y)),this.updateIndicator(this.sizes.side==bnt.SIDE.WIDTH?y/Math.abs(this.sizes.y):x/Math.abs(this.sizes.x)),this.elementPosition.x=x,this.elementPosition.y=y,this.updateElementPosition(x+this.sizes.x,y+this.sizes.y))},ElementWithPan.prototype.updateWithPointerMovement=function(scale){var xSpeed,speed=__read(scale,2),x=speed[0],y=speed[1];return this.pointerEventsEnabled&&(this.resettingToCenter.active=!1,this.pointerPosition&&(scale=this.options.container.element.getBoundingClientRect().width/this.options.container.width(this.config),this.pointerLastPosition||(this.pointerLastPosition=this.pointerPosition.clone()),speed=bnt.Point.zero,this.sizes.side==bnt.SIDE.WIDTH?(xSpeed=this.pointerPosition.y-this.pointerLastPosition.y,y+=xSpeed/=scale,speed.y=xSpeed):this.sizes.side==bnt.SIDE.HEIGHT&&(xSpeed=this.pointerPosition.x-this.pointerLastPosition.x,x+=xSpeed/=scale,speed.x=xSpeed),5<speed.size()&&(this.pointerAfterSpeed=speed),this.pointerLastPosition=this.pointerPosition.clone())),[x,y]},ElementWithPan.prototype.updateWithPointerAfterMovement=function(getXorYSign){var getXorY_1,_this=this,sign=__read(getXorYSign,3),x=sign[0],y=sign[1],speedPoint=sign[2];return 0<=this.pointerAfterSpeed.size()&&!this.pointerDown&&(x=this.pointerAfterSpeed.x,y=this.pointerAfterSpeed.y,getXorY_1=function(){return _this.pointerAfterSpeed.x||_this.pointerAfterSpeed.y},sign=(getXorYSign=function(){return ElementWithPan.sign(getXorY_1())})(),speedPoint=8*-getXorY_1()*speedPoint,speedPoint=new bnt.Point(this.pointerAfterSpeed.x&&speedPoint,this.pointerAfterSpeed.y&&speedPoint),this.pointerAfterSpeed=this.pointerAfterSpeed.plus(speedPoint),sign!=getXorYSign()&&(this.pointerAfterSpeed=bnt.Point.zero),this.pointerAfterSpeed.size()<.05&&(this.pointerAfterSpeed=bnt.Point.zero)),[x,y]},ElementWithPan.prototype.updateWithGyroMovement=function(positionDelta){var directionDelta=__read(positionDelta,2),x=directionDelta[0],y=directionDelta[1];if(!this.gyroscopeEnabled)return[x,y];if(this.deviceRotation){if(this.deviceLastRotation||(this.deviceLastRotation={alpha:this.deviceRotation.alpha,beta:this.deviceRotation.beta,gamma:this.deviceRotation.gamma}),this.resettingToCenter.active)return[x,y];positionDelta=void 0,directionDelta=30*(this.deviceRotation.alpha-this.deviceLastRotation.alpha);bnt.ScreenOrientation.isLandscape&&this.sizes.side==bnt.SIDE.HEIGHT||bnt.ScreenOrientation.isPortrait&&this.sizes.side==bnt.SIDE.WIDTH?(positionDelta=30*(this.deviceRotation.beta-this.deviceLastRotation.beta),bnt.ScreenOrientation.isPortrait&&this.sizes.side==bnt.SIDE.WIDTH&&(positionDelta*=-1)):(positionDelta=30*(this.deviceRotation.gamma-this.deviceLastRotation.gamma),bnt.ScreenOrientation.is(bnt.ScreenOrientationType.LandscapeRight)&&(positionDelta*=-1)),this.sizes.side==bnt.SIDE.WIDTH?y+=positionDelta+directionDelta:this.sizes.side==bnt.SIDE.HEIGHT&&(x+=positionDelta+directionDelta)}return[x,y]},ElementWithPan.prototype.updateGyroLastRotations=function(){this.deviceRotation&&(this.deviceLastRotation={alpha:this.deviceRotation.alpha,beta:this.deviceRotation.beta,gamma:this.deviceRotation.gamma})},ElementWithPan.prototype.resetToCenter=function(dt){this.resettingToCenter.percentageDone=this.resettingToCenter.percentageDone.plus(this.resettingToCenter.speed.mul(dt)),this.resettingToCenter.percentageDone.x=ElementWithPan.clamp01(this.resettingToCenter.percentageDone.x),this.resettingToCenter.percentageDone.y=ElementWithPan.clamp01(this.resettingToCenter.percentageDone.y),this.elementPosition.x=ElementWithPan.lerp(this.resettingToCenter.startPosition.x,0,this.resettingToCenter.percentageDone.x),this.elementPosition.y=ElementWithPan.lerp(this.resettingToCenter.startPosition.y,0,this.resettingToCenter.percentageDone.y),1==this.resettingToCenter.percentageDone.x&&1==this.resettingToCenter.percentageDone.y&&(this.resettingToCenter.active=!1)},ElementWithPan.prototype.updateIndicator=function(percent){bnt.style(this.indicator,{transform:"translate(-50%, -50%) rotate(".concat(60*-percent,"deg)")})},ElementWithPan.prototype.hideIndicator=function(){this.indicatorWrap.hidden=!0},ElementWithPan.prototype.showIndicator=function(){this.indicatorWrap.hidden=!1},ElementWithPan.prototype.updateElementPosition=function(x,y){this.options.element.element&&bnt.style(this.options.element.element,{left:bnt.px(x),top:bnt.px(y)})},ElementWithPan.prototype.updateConfig=function(config){config.panActive?this.autoenable&&this.enable():this.disable(),this.config=config,this.enabled?this.sizes=bnt.ScaleToFill.getSizes(this.options.container.width(this.config),this.options.container.height(this.config),this.options.element.width(this.config),this.options.element.height(this.config)):this.sizes={x:0,y:0,w:this.options.container.width(this.config),h:this.options.container.height(this.config),side:bnt.SIDE.NONE},this.onSizesChange.update(this.sizes)},ElementWithPan.prototype.enable=function(){this.enabled=!0,this.showIndicator()},ElementWithPan.prototype.disable=function(){this.enabled=!1,this.hideIndicator()},ElementWithPan.prototype.forceUpdateLastConfig=function(){this.config&&this.updateConfig(this.config)},ElementWithPan.prototype.preventAutoEnable=function(value){var oldAutoenable=this.autoenable;this.autoenable=!value,oldAutoenable!=this.autoenable&&this.forceUpdateLastConfig()},ElementWithPan.sign=function(value){return value<0?-1:1},ElementWithPan.clamp01=function(value){return ElementWithPan.clamp(value,0,1)},ElementWithPan.clamp=function(value,min,max){return max<value?max:value<min?min:value},ElementWithPan.clampAbs=function(value,abs){return ElementWithPan.clamp(value,-abs,abs)},ElementWithPan.lerp=function(v0,v1,t){return v0*(1-t)+v1*t},ElementWithPan.elements=[],ElementWithPan.inited=!1,ElementWithPan}();bnt.ElementWithPan=ElementWithPan}(bnt=bnt||{}),function(bnt){bnt.Timeline=function(){}}(bnt=bnt||{}),function(bnt){var CreativeTimeline=function(){function CreativeTimeline(creativeRenderer){this.creativeRenderer=creativeRenderer}return CreativeTimeline.prototype.getScreen=function(){return bnt.get(bnt.MainStage).currentScreen},CreativeTimeline.prototype.play=function(){return this.getScreen().play()},CreativeTimeline.prototype.pause=function(){return this.getScreen().pause()},CreativeTimeline.prototype.stop=function(){return this.getScreen().stop()},CreativeTimeline.prototype.suspend=function(){return this.getScreen().suspend()},CreativeTimeline.prototype.resume=function(){return this.getScreen().resume()},CreativeTimeline.prototype.mute=function(){return this.getScreen().mute()},CreativeTimeline.prototype.unmute=function(){return this.getScreen().unmute()},CreativeTimeline}();bnt.CreativeTimeline=CreativeTimeline}(bnt=bnt||{}),function(bnt){var VideoTimeline=function(){function VideoTimeline(videoRenderer){this.videoRenderer=videoRenderer,this.paused=!0}return VideoTimeline.prototype.play=function(){var _this=this;this.paused=!1;var p=new bnt.Promise;return bnt.Promise.tryFulfill(function(){return _this.videoRenderer.videoElement.play()}).onComplete(function(_){if(_ instanceof bnt.Failure){var knownFailure=!1;try{_.failure.code===DOMException.ABORT_ERR&&(knownFailure=!0)}catch(er){}knownFailure||(console.error(_.failure),bnt.get(bnt.AdController).onerror.update(_.failure.message))}p.succeed(void 0)}),p.future},VideoTimeline.prototype.pause=function(){return this.videoRenderer.videoElement.pause(),this.paused=!0,bnt.Promise.fulfilledWith(void 0).future},VideoTimeline.prototype.stop=function(){var _this=this;return this.pause().map(function(){_this.videoRenderer.videoElement.currentTime=0})},VideoTimeline.prototype.suspend=function(){return this.paused||this.videoRenderer.videoElement.pause(),bnt.Promise.fulfilledWith(void 0).future},VideoTimeline.prototype.resume=function(){var _this=this;return this.paused?bnt.Promise.fulfilledWith(void 0).future:bnt.Promise.tryFulfill(function(){return _this.videoRenderer.videoElement.play()}).map(function(_){return _})},VideoTimeline.prototype.mute=function(){var _this=this;return bnt.Promise.tryFulfill(function(){return _this.videoRenderer.videoElement.muted=!0})},VideoTimeline.prototype.unmute=function(){var _this=this;return bnt.Promise.tryFulfill(function(){return _this.videoRenderer.videoElement.muted=!1})},__decorate([bnt.Action({actionOf:bnt.Video}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],VideoTimeline.prototype,"play",null),__decorate([bnt.Action({actionOf:bnt.Video}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],VideoTimeline.prototype,"pause",null),__decorate([bnt.Action({actionOf:bnt.Video}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],VideoTimeline.prototype,"stop",null),__decorate([bnt.Action({actionOf:bnt.Video}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],VideoTimeline.prototype,"mute",null),__decorate([bnt.Action({actionOf:bnt.Video}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],VideoTimeline.prototype,"unmute",null),VideoTimeline}();bnt.VideoTimeline=VideoTimeline}(bnt=bnt||{}),function(bnt){var ScreenTimeline=function(_super){function ScreenTimeline(duration){var _this=_super.call(this)||this;_this.screenRenderer=duration;var videoCount=_this.screenRenderer.screen.deepGetEosByType(bnt.Video).length,duration=duration.screen.config.duration,duration=0==videoCount?duration<.01?15:duration:duration;return 0!=duration&&(_this.timedTimeline=new TimelineTimer(1e3*duration),_this.timedTimeline.play().map(function(_){return _this.timedTimeline.suspend()}),_this.screenRenderer.screen.onshowAnimationStart.addObserver(function(){return _this.timedTimeline.resume()}),_this.screenRenderer.screen.onhideAnimationEnd.addObserver(function(){return _this.timedTimeline.suspend()})),_this}return __extends(ScreenTimeline,_super),ScreenTimeline.prototype.getElementsWithTimeline=function(){var fn=function(container){var arr=[];return container.forEachEos(function(eos){eos.element.hasOwnProperty("timeline")&&arr.push(eos.element),eos.element instanceof bnt.Group&&(arr=__spreadArray(__spreadArray([],__read(arr),!1),__read(fn(eos.element)),!1))}),arr},ewt=fn(this.screenRenderer.screen);return this.timedTimeline&&ewt.push(this.timedTimeline),ewt},ScreenTimeline.prototype.play=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.play()}))},ScreenTimeline.prototype.pause=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.pause()}))},ScreenTimeline.prototype.stop=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.stop()}))},ScreenTimeline.prototype.suspend=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.suspend()}))},ScreenTimeline.prototype.resume=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.resume()}))},ScreenTimeline.prototype.mute=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.mute()}))},ScreenTimeline.prototype.unmute=function(){return bnt.Promise.forAll(this.getElementsWithTimeline().map(function(e){return e.unmute()}))},ScreenTimeline.prototype.getRemainingTime=function(){return this.timedTimeline?this.timedTimeline.remainingTimeMillisec.value:this.getElementsWithTimeline().reduce(function(maxRemainingTime,ewt){return Math.max(maxRemainingTime,ewt.remainingTimeMillisec.value)},-1)},ScreenTimeline.prototype.getDuration=function(){return this.timedTimeline?this.timedTimeline.duration.value:this.getElementsWithTimeline().reduce(function(maxDuration,ewt){return Math.max(maxDuration,ewt.duration.value)},-1)},ScreenTimeline.prototype.getTime=function(){return this.timedTimeline?this.timedTimeline.timeMillisec.value:this.getElementsWithTimeline().reduce(function(maxTime,ewt){return Math.max(maxTime,ewt.timeMillisec.value)},-1)},ScreenTimeline}(bnt.Timeline);bnt.ScreenTimeline=ScreenTimeline;var TimelineTimer=function(_super){function TimelineTimer(duration){var _this=_super.call(this)||this;return _this.paused=!1,_this.onplay=new bnt.Observable,_this.onpause=new bnt.Observable,_this.onstop=new bnt.Observable,_this.onend=new bnt.Observable,_this.muted=new bnt.ObservableValue,_this.duration=new bnt.ObservableValue,_this.remainingTimeMillisec=new bnt.ObservableValue(-1),_this.timeMillisec=new bnt.ObservableValue,_this.volume=new bnt.ObservableValue,_this.updateCallback=function(){_this.timeMillisec.update(_this.timer.getTime()/1e3),_this.remainingTimeMillisec.update(_this.timer.getTimeRemaining()/1e3),0===_this.timer.getTimeRemaining()&&(clearInterval(_this.tickIntervalID),_this.onend.update(void 0))},(_this.timeline=_this).timer=new bnt.Timer(duration),_this}return __extends(TimelineTimer,_super),TimelineTimer.prototype.play=function(){return this.paused=!1,this.timer.play(),clearInterval(this.tickIntervalID),this.tickIntervalID=setInterval(this.updateCallback.bind(this),TimelineTimer.TICKING_INTERVAL),this.duration.update(this.timer.duration/1e3),bnt.Promise.fulfilledWith(this.onplay.update(void 0)).future},TimelineTimer.prototype.pause=function(){return this.paused=!0,clearInterval(this.tickIntervalID),this.timer.pause(),bnt.Promise.fulfilledWith(this.onpause.update(void 0)).future},TimelineTimer.prototype.stop=function(){return clearInterval(this.tickIntervalID),this.timer.stop(),bnt.Promise.fulfilledWith(this.onstop.update(void 0)).future},TimelineTimer.prototype.suspend=function(){return this.paused?bnt.Promise.failedWith(void 0).future:(clearInterval(this.tickIntervalID),this.timer.pause(),bnt.Promise.fulfilledWith(void 0).future)},TimelineTimer.prototype.resume=function(){return this.paused?bnt.Promise.failedWith(void 0).future:(this.timer.play(),clearInterval(this.tickIntervalID),this.tickIntervalID=setInterval(this.updateCallback.bind(this),TimelineTimer.TICKING_INTERVAL),bnt.Promise.fulfilledWith(void 0).future)},TimelineTimer.prototype.mute=function(){return this.muted.update(!0),bnt.Promise.fulfilledWith(void 0).future},TimelineTimer.prototype.unmute=function(){return this.muted.update(!1),bnt.Promise.fulfilledWith(void 0).future},TimelineTimer.TICKING_INTERVAL=200,TimelineTimer}(bnt.Timeline)}(bnt=bnt||{}),function(bnt){var SoundIconManager=function(){function SoundIconManager(){this.initialized=!1,this.customScriptDetected=!1,this.monitoringInterval=null,this.creative=null,this.soundIconSuppressedByAction=!1}return SoundIconManager.getInstance=function(){return SoundIconManager.instance=!SoundIconManager.instance?new SoundIconManager:SoundIconManager.instance},SoundIconManager.prototype.init=function(creative){var _this=this;if(this.soundIconSuppressedByAction=!1,!this.initialized){this.initialized=!0,this.creative=creative;try{setTimeout(function(){_this.hasExistingCustomSoundIconScript()?_this.customScriptDetected=!0:(creative&&creative.screens&&0<creative.screens.length&&_this.updateSoundIconForScreen(creative.screens[0]),_this.setupVideoPlayObservers(creative),creative.onscreenchange&&creative.onscreenchange.addObserver(function(_a){var to=_a.to;to&&setTimeout(function(){return _this.updateSoundIconForScreen(to)},SoundIconManager.VIDEO_UPDATE_DELAY_MS)}))},SoundIconManager.INIT_DELAY_MS),this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.startCustomScriptMonitoring()}catch(e){console.error("SoundIconManager: Error during initialization:",e)}}},SoundIconManager.prototype.getVideoConfig=function(video){try{if(!video||"function"!=typeof video.getConfig)return null;var state=bnt.get(bnt.State);return state?video.getConfig(state):null}catch(e){return console.warn("SoundIconManager: Error getting video config:",e),null}},SoundIconManager.prototype.setupVideoPlayObservers=function(creative){var _this=this;creative&&creative.screens&&creative.screens.forEach(function(screen){try{if(!screen||"function"!=typeof screen.deepGetEosByType)return;var videoEosList=screen.deepGetEosByType(bnt.Video);if(!videoEosList||0===videoEosList.length)return;videoEosList.forEach(function(eos){try{var video=eos.element;video&&video.onplay&&"function"==typeof video.onplay.addObserver&&video.onplay.addObserver(function(){setTimeout(function(){_this.updateSoundIconForScreen(screen)},SoundIconManager.VIDEO_UPDATE_DELAY_MS)})}catch(e){console.warn("SoundIconManager: Error setting up video observer:",e)}})}catch(e){console.warn("SoundIconManager: Error processing screen:",e)}})},SoundIconManager.prototype.updateSoundIconForScreen=function(screen){try{if(this.soundIconSuppressedByAction)return void this.hideSoundIcon();if(!screen||"function"!=typeof screen.deepGetEosByType)return;var videoEosList=screen.deepGetEosByType(bnt.Video);if(!videoEosList||0===videoEosList.length)return void this.hideSoundIcon();for(var soundIconApplied=!1,hasAnySoundIconConfigured=!1,index=0;index<videoEosList.length;index++){var eos=videoEosList[index];try{var video=eos.element,config=this.getVideoConfig(video);if(!config)continue;if((config.soundIconConfigured||config.soundIconVisible)&&(hasAnySoundIconConfigured=!0),!config.soundIconConfigured&&!config.soundIconVisible)continue;if(this.isScreenHidden(screen,config.soundIconHiddenScreens))continue;if(config.soundIconVisible&&config.src){this.applySoundIconSettings(config),soundIconApplied=!0;break}}catch(e){console.warn("SoundIconManager: Error processing video element:",e)}}hasAnySoundIconConfigured&&!soundIconApplied&&this.hideSoundIcon()}catch(e){console.error("SoundIconManager: Error in updateSoundIconForScreen:",e)}},SoundIconManager.prototype.isScreenHidden=function(screen,hiddenScreens){return!(!hiddenScreens||""===hiddenScreens.trim())&&hiddenScreens.split(",").map(function(name){return name.trim()}).includes(screen.name)},SoundIconManager.prototype.applySoundIconSettings=function(config){try{if(this.customScriptDetected||this.hasExistingCustomSoundIconScript())return;if(!config.soundIconConfigured)return;this.isPreviewEnvironment()?this.handlePreviewMode(config):bnt.TeadsPlayerAddons&&"function"==typeof bnt.TeadsPlayerAddons.callPlayerApiMethod?this.applyRealPlayerSettings(config):(console.warn("SoundIconManager: Unknown environment - attempting preview mode"),this.handlePreviewMode(config))}catch(e){console.error("SoundIconManager: Error applying sound icon settings:",e)}},SoundIconManager.prototype.isPreviewEnvironment=function(){try{if(document.querySelector(".stu-screen")||document.querySelector(".preview-container"))return!0;if("undefined"!=typeof window&&window.location&&(window.location.href.includes("preview")||window.location.href.includes("studio")))return!0;if("undefined"!=typeof window&&window.parent&&window.parent!==window)try{if(window.parent.location.href.includes("studio")||window.parent.location.href.includes("preview"))return!0}catch(e){}return!1}catch(e){return console.warn("SoundIconManager: Error detecting environment:",e),!1}},SoundIconManager.prototype.applyRealPlayerSettings=function(config){try{var soundIconCSS=this.generateSoundIconCSS(config);this.injectCSSDirectly(soundIconCSS),bnt.TeadsPlayerAddons.callPlayerApiMethod("customizeUI",[soundIconCSS]),bnt.TeadsPlayerAddons.callPlayerApiMethod("setSoundControlVisibility",[!0])}catch(e){console.error("SoundIconManager: Error applying real player settings:",e)}},SoundIconManager.prototype.handlePreviewMode=function(config){try{this.createPreviewSoundIcon(config)}catch(e){console.error("SoundIconManager: Error in preview mode:",e)}},SoundIconManager.prototype.createPreviewSoundIcon=function(config){try{var existingIcon=document.getElementById(SoundIconManager.PREVIEW_ICON_ID);existingIcon&&existingIcon.remove();var soundIcon=this.createPreviewIconElement(config);this.attachPreviewIcon(soundIcon)}catch(e){console.error("SoundIconManager: Error creating preview sound icon:",e)}},SoundIconManager.prototype.createPreviewIconElement=function(iconColor){var backgroundColor=this.calculateScale(),hasCustomX=void 0!==iconColor.soundIconX&&0!==iconColor.soundIconX,hasCustomY=void 0!==iconColor.soundIconY&&0!==iconColor.soundIconY,scaledX=(iconColor.soundIconX||0)*backgroundColor,scaledY=(iconColor.soundIconY||0)*backgroundColor,scaledIconSize=(null!==(scaledBackgroundSize=iconColor.soundIconSize)&&void 0!==scaledBackgroundSize?scaledBackgroundSize:SoundIconManager.ICON_SIZE_PX)*backgroundColor,scaledBackgroundSize=(null!==(container=iconColor.soundIconBackgroundSize)&&void 0!==container?container:0)*backgroundColor,container=Math.max(scaledIconSize,scaledBackgroundSize),backgroundColor=SoundIconManager.PREVIEW_EDGE_PADDING_PX+container/2,container=document.createElement("div");container.id=SoundIconManager.PREVIEW_ICON_ID,container.className="preview-sound-icon-container",container.style.cssText="\n        position: absolute !important;\n        display: flex !important;\n        align-items: center !important;\n        justify-content: center !important;\n        z-index: ".concat(SoundIconManager.PREVIEW_ICON_Z_INDEX," !important;\n        pointer-events: none !important;\n        ").concat(hasCustomX?"left: ".concat(scaledX,"px !important; transform: translateX(-50%) translateY(-50%) !important;"):"right: ".concat(backgroundColor,"px !important;"),"\n        ").concat(hasCustomY?"top: ".concat(scaledY,"px !important;"):"bottom: ".concat(backgroundColor,"px !important;"),"\n      "),0<scaledBackgroundSize&&((soundIcon=document.createElement("div")).className="preview-sound-icon-background",backgroundColor=iconColor.soundIconBackgroundColor||"#000000",soundIcon.style.cssText="\n          position: absolute !important;\n          width: ".concat(scaledBackgroundSize,"px !important;\n          height: ").concat(scaledBackgroundSize,"px !important;\n          border-radius: 50% !important;\n          background-color: ").concat(backgroundColor," !important;\n          pointer-events: none !important;\n        "),container.appendChild(soundIcon));var soundIcon=document.createElement("div");soundIcon.className="teads-ui-component-soundbutton preview-sound-icon";iconColor=iconColor.soundIconColor||"#ffffff";return soundIcon.style.cssText="\n        position: relative !important;\n        width: ".concat(scaledIconSize,"px !important;\n        height: ").concat(scaledIconSize,"px !important;\n        display: flex !important;\n        align-items: center !important;\n        justify-content: center !important;\n        pointer-events: none !important;\n        color: ").concat(iconColor," !important;\n        z-index: 1 !important;\n      "),this.setPreviewIconContent(soundIcon),container.appendChild(soundIcon),container},SoundIconManager.prototype.setPreviewIconContent=function(soundIcon){try{soundIcon.innerHTML='\n          <svg viewBox="0 0 24 24" style="width: 100%; height: 100%; fill: currentColor;">\n            <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>\n          </svg>\n        ',document.createElementNS||(soundIcon.innerHTML="🔊")}catch(e){soundIcon.innerHTML="🔊"}},SoundIconManager.prototype.attachPreviewIcon=function(soundIcon){document.body.appendChild(soundIcon)},SoundIconManager.prototype.removePreviewSoundIcon=function(){var previewIcon=document.getElementById(SoundIconManager.PREVIEW_ICON_ID);previewIcon&&previewIcon.remove()},SoundIconManager.prototype.hideSoundIcon=function(){try{var hiddenCSS;this.removePreviewSoundIcon(),!this.isPreviewEnvironment()&&bnt.TeadsPlayerAddons&&"function"==typeof bnt.TeadsPlayerAddons.callPlayerApiMethod&&(bnt.TeadsPlayerAddons.callPlayerApiMethod("setSoundControlVisibility",[!1]),hiddenCSS="\n            div.teads-ui-component-soundbutton {\n              display: none !important;\n              visibility: hidden !important;\n              opacity: 0 !important;\n            }\n            .icon-muteoff, .icon-muteon {\n              display: none !important;\n            }\n            #preview-sound-icon {\n              display: none !important;\n            }\n          ",bnt.TeadsPlayerAddons.callPlayerApiMethod("customizeUI",[hiddenCSS]),this.injectCSSDirectly(hiddenCSS))}catch(e){console.warn("SoundIconManager: Error hiding sound icon:",e)}},SoundIconManager.prototype.suppressSoundIcon=function(){this.soundIconSuppressedByAction=!0,this.hideSoundIcon()},SoundIconManager.prototype.generateSoundIconCSS=function(muteoffSvg){var css="";css+="\n        div.teads-ui-component-soundbutton { \n          display: block !important; \n          visibility: visible !important; \n        }\n      ";var scaledX,backgroundColor,leftPos=this.calculateScale(),hasCustomX=void 0!==muteoffSvg.soundIconX&&0!==muteoffSvg.soundIconX,hasCustomY=void 0!==muteoffSvg.soundIconY&&0!==muteoffSvg.soundIconY,topPos=hasCustomX||hasCustomY,muteonSvg=(null!==(bottomPos=muteoffSvg.soundIconSize)&&void 0!==bottomPos?bottomPos:SoundIconManager.ICON_SIZE_PX)*leftPos,scaledBackgroundSize=(null!==(scaledX=muteoffSvg.soundIconBackgroundSize)&&void 0!==scaledX?scaledX:0)*leftPos,rightPos=Math.max(muteonSvg,scaledBackgroundSize),bottomPos=SoundIconManager.DEFAULT_EDGE_PADDING_PX+rightPos/2;return topPos?(scaledX=(muteoffSvg.soundIconX||0)*leftPos,backgroundColor=(muteoffSvg.soundIconY||0)*leftPos,rightPos=muteonSvg/2,topPos="undefined"!=typeof window?window.innerWidth:SoundIconManager.DEFAULT_CANVAS_WIDTH,leftPos="undefined"!=typeof window?window.innerHeight:720,topPos=bnt.mathUtils.clamp(rightPos,scaledX,topPos-rightPos),backgroundColor=bnt.mathUtils.clamp(rightPos,backgroundColor,leftPos-rightPos),leftPos=hasCustomX?"left: ".concat(topPos,"px !important;"):"left: auto !important;",rightPos=hasCustomX?"right: auto !important;":"right: ".concat(bottomPos,"px !important;"),topPos=hasCustomY?"top: ".concat(backgroundColor,"px !important;"):"top: auto !important;",bottomPos=hasCustomY?"bottom: auto !important;":"bottom: ".concat(bottomPos,"px !important;"),backgroundColor="",hasCustomX&&(backgroundColor+="translateX(-50%) "),hasCustomY&&(backgroundColor+="translateY(-50%) "),backgroundColor=backgroundColor?"transform: ".concat(backgroundColor.trim()," !important; -webkit-transform: ").concat(backgroundColor.trim()," !important;"):"",css+="\n          div.teads-ui-component-soundbutton {\n            position: absolute !important;\n            ".concat(leftPos,"\n            ").concat(rightPos,"\n            ").concat(topPos,"\n            ").concat(bottomPos,"\n            ").concat(backgroundColor,"\n            padding: 0px !important;\n            width: ").concat(muteonSvg,"px !important;\n            height: ").concat(muteonSvg,"px !important;\n            display: flex !important;\n            justify-content: center !important;\n            align-items: center !important;\n          }\n        ")):css+="\n          div.teads-ui-component-soundbutton {\n            width: ".concat(muteonSvg,"px !important;\n            height: ").concat(muteonSvg,"px !important;\n            display: flex !important;\n            justify-content: center !important;\n            align-items: center !important;\n          }\n        "),0<scaledBackgroundSize&&(backgroundColor=muteoffSvg.soundIconBackgroundColor||"#000000",css+="\n          div.teads-ui-component-soundbutton::before {\n            content: '' !important;\n            position: absolute !important;\n            width: ".concat(scaledBackgroundSize,"px !important;\n            height: ").concat(scaledBackgroundSize,"px !important;\n            border-radius: 50% !important;\n            background-color: ").concat(backgroundColor," !important;\n            z-index: -1 !important;\n          }\n        ")),css+="\n        .icon-muteon, .icon-muteoff {\n          width: ".concat(muteonSvg,"px !important;\n          height: ").concat(muteonSvg,"px !important;\n        }\n      "),muteoffSvg.soundIconConfigured&&muteoffSvg.soundIconColor&&(muteonSvg=this.generateSoundIconSVG(muteoffSvg.soundIconColor,!0),muteoffSvg=this.generateSoundIconSVG(muteoffSvg.soundIconColor,!1),css+="\n          .icon-muteon {\n            background-image: url('".concat(muteonSvg,"') !important;\n            background-size: contain !important;\n            background-position: center !important;\n            background-repeat: no-repeat !important;\n          }\n        "),css+="\n          .icon-muteoff {\n            background-image: url('".concat(muteoffSvg,"') !important;\n            background-size: contain !important;\n            background-position: center !important;\n            background-repeat: no-repeat !important;\n          }\n        ")),css},SoundIconManager.prototype.generateSoundIconSVG=function(color,encodedSvg){encodedSvg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">\n             <path fill="'.concat(color,encodedSvg?'" d="M3.63 3.63a.996.996 0 000 1.41L7.29 8.7 7 9H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 101.41-1.41L5.05 3.63c-.39-.39-1.02-.39-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85C17.18 6.54 19 9.06 19 12zm-8.71-6.29l-.17.17L12 7.76V6.41c0-.89-1.08-1.33-1.71-.7zM16.5 12A4.5 4.5 0 0014 7.97v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"/>\n           </svg>':'" d="M3 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.33-1.71-.71L7 9H4c-.55 0-1 .45-1 1zm13.5 2A4.5 4.5 0 0014 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 4.45v.2c0 .38.25.71.6.85C17.18 6.53 19 9.06 19 12s-1.82 5.47-4.4 6.5c-.36.14-.6.47-.6.85v.2c0 .63.63 1.07 1.21.85C18.6 19.11 21 15.84 21 12s-2.4-7.11-5.79-8.4c-.58-.23-1.21.22-1.21.85z"/>\n           </svg>'),encodedSvg=encodeURIComponent(encodedSvg).replace(/'/g,"%27").replace(/"/g,"%22");return"data:image/svg+xml,".concat(encodedSvg)},SoundIconManager.prototype.calculateScale=function(){try{if("undefined"==typeof window||!window.innerWidth)return console.warn("SoundIconManager: No window available for scale calculation, using scale = 1"),1;if(this.creative&&this.creative.canvases&&0<this.creative.canvases.length){var canvasWidth=this.creative.canvases[0].config.width;if(canvasWidth&&0<canvasWidth)return window.innerWidth/canvasWidth}return window.innerWidth/SoundIconManager.DEFAULT_CANVAS_WIDTH}catch(e){return console.warn("SoundIconManager: Error calculating scale factor:",e),1}},SoundIconManager.prototype.injectCSSDirectly=function(css){try{var existingStyle=document.getElementById(SoundIconManager.CUSTOM_STYLE_ID);existingStyle&&existingStyle.remove();var style_1=document.createElement("style");style_1.id=SoundIconManager.CUSTOM_STYLE_ID,style_1.type="text/css",style_1.innerHTML=css,document.head.appendChild(style_1)}catch(e){console.warn("SoundIconManager: Error injecting CSS directly:",e)}},SoundIconManager.prototype.hasExistingCustomSoundIconScript=function(){var e_14,_a,e_15,_b,e_16,_c;try{var scripts=document.querySelectorAll("script");try{for(var scripts_1=__values(scripts),scripts_1_1=scripts_1.next();!scripts_1_1.done;scripts_1_1=scripts_1.next()){var script=scripts_1_1.value;if(script.innerHTML&&script.innerHTML.includes("TeadsPlayerAddons.callPlayerApiMethod")&&script.innerHTML.includes("customizeUI")&&script.innerHTML.includes("teads-ui-component-soundbutton"))return!0}}catch(e_14_1){e_14={error:e_14_1}}finally{try{scripts_1_1&&!scripts_1_1.done&&(_a=scripts_1.return)&&_a.call(scripts_1)}finally{if(e_14)throw e_14.error}}var existingStyles=document.querySelectorAll("style");try{for(var existingStyles_1=__values(existingStyles),existingStyles_1_1=existingStyles_1.next();!existingStyles_1_1.done;existingStyles_1_1=existingStyles_1.next()){var style_2=existingStyles_1_1.value;if(style_2.id!==SoundIconManager.CUSTOM_STYLE_ID&&(style_2.innerHTML&&(style_2.innerHTML.includes(".teads-ui-component-soundbutton")||style_2.innerHTML.includes(".icon-muteoff")||style_2.innerHTML.includes(".icon-muteon"))))return!0}}catch(e_15_1){e_15={error:e_15_1}}finally{try{existingStyles_1_1&&!existingStyles_1_1.done&&(_b=existingStyles_1.return)&&_b.call(existingStyles_1)}finally{if(e_15)throw e_15.error}}if("undefined"!=typeof window)try{for(var globalVars_1=__values(["soundConfig","createVisibleCss","createHiddenCss","createVisualCss"]),globalVars_1_1=globalVars_1.next();!globalVars_1_1.done;globalVars_1_1=globalVars_1.next()){var varName=globalVars_1_1.value;if(window[varName])return!0}}catch(e_16_1){e_16={error:e_16_1}}finally{try{globalVars_1_1&&!globalVars_1_1.done&&(_c=globalVars_1.return)&&_c.call(globalVars_1)}finally{if(e_16)throw e_16.error}}return!1}catch(e){return console.warn("SoundIconManager: Error checking for existing custom scripts:",e),!1}},SoundIconManager.prototype.startCustomScriptMonitoring=function(){var _this=this;this.monitoringInterval=setInterval(function(){!_this.customScriptDetected&&_this.hasExistingCustomSoundIconScript()&&(_this.customScriptDetected=!0,_this.removeUIStyles(),_this.monitoringInterval&&(clearInterval(_this.monitoringInterval),_this.monitoringInterval=null))},SoundIconManager.MONITORING_INTERVAL_MS)},SoundIconManager.prototype.removeUIStyles=function(){try{var existingStyle=document.getElementById(SoundIconManager.CUSTOM_STYLE_ID);existingStyle&&existingStyle.remove()}catch(e){console.warn("SoundIconManager: Error removing UI styles:",e)}},SoundIconManager.INIT_DELAY_MS=300,SoundIconManager.VIDEO_UPDATE_DELAY_MS=100,SoundIconManager.MONITORING_INTERVAL_MS=200,SoundIconManager.PREVIEW_ICON_Z_INDEX=999999,SoundIconManager.DEFAULT_CANVAS_WIDTH=1280,SoundIconManager.ICON_SIZE_PX=40,SoundIconManager.DEFAULT_EDGE_PADDING_PX=16,SoundIconManager.PREVIEW_EDGE_PADDING_PX=20,SoundIconManager.CUSTOM_STYLE_ID="sound-icon-custom-styles",SoundIconManager.PREVIEW_ICON_ID="preview-sound-icon",SoundIconManager}();bnt.SoundIconManager=SoundIconManager}(bnt=bnt||{}),function(bnt){function getClickThruUrl(url){return url?bnt.TeadsPlayerAddons.apiProxy.futureMap(function(api){return api?api.getContextData():bnt.Promise.fulfilledWith(null).future}).map(function(clickThruOverride){if(clickThruOverride&&clickThruOverride.tracking&&clickThruOverride.tracking.click_through_override){clickThruOverride=clickThruOverride.tracking.click_through_override;if(new RegExp("^(http|https):\\/\\/[\\w-]+(\\.[\\w-]+)+(\\S)*$").test(clickThruOverride))return clickThruOverride}return url}):new bnt.ObservableValue(url)}bnt.getClickThruUrl=getClickThruUrl;var AdController=function(){function AdController(creative){this.creative=creative,this.desiredExpandState=new bnt.Observable,this.rendered=!1,this.expanded=!1,this.expanding=!1,this.collapsing=!1,this.preventDefaultTouchEvents=!1,this.signalObserversMap=[],this.resizeController=bnt.get(bnt.ResizeController),this.scrollController=bnt.get(bnt.ScrollController),this.isBannerAd=!1,AdController.instance=this;var ll=Number(bnt.QueryParams.get("logLevel"));isNaN(ll)&&(ll=Number(bnt.LogLevel[bnt.QueryParams.get("logLevel")])),bnt.logger.LOG_LEVEL=isNaN(ll)?bnt.LogLevel.error:ll,this.element=document.body||document.documentElement,this.onstart=new bnt.Observable,this.ondestroy=new bnt.Observable,this.onresume=new bnt.Observable,this.onsuspend=new bnt.Observable,this.onclickthru=new bnt.Observable,this.interaction=new bnt.Observable,this.onerror=new bnt.Observable,this.onplay=new bnt.Observable,this.onpause=new bnt.Observable,this.fullscreen=new bnt.ObservableValue(!1),this.setAutoResize(!0),this.stateChangeDetector=new bnt.StateChangeDetector(creative.segments,creative.canvases),this.stateChangeDetector.stateUpdated.addObserver(function(state){bnt.set(bnt.State,state)}),bnt.set(bnt.StateChangeDetector,this.stateChangeDetector),bnt.set(bnt.Creative,this.creative),bnt.set(bnt.net.Monitor,new bnt.net.Monitor),bnt.set(AdController,this),creative.setController(this),bnt.DynamicData.init(),bnt.QueryParams.init()}return AdController.prototype.sendAdClickThru=function(url){this.isBannerAd&&bnt.TeadsPlayerAddons.apiProxy.addObserver(function(api){api&&api.isStudioDisplay().onSuccess(function(isStudioDisplay){isStudioDisplay&&api.sendAdClickThru({url:url,id:null,playerHandles:!1})})})},AdController.prototype.getStageWidth=function(){return bnt.get(bnt.ResizeController).previous.width},AdController.prototype.getStageHeight=function(){return bnt.get(bnt.ResizeController).previous.height},AdController.prototype.getSkippable=function(){return this.creative.skippable.value},AdController.prototype.getRemainingTime=function(){return this.creative.remainingTimeMillisec.value},AdController.prototype.getDuration=function(){return this.creative.duration.value},AdController.prototype.getVolume=function(){return this.creative.volume.value},AdController.prototype.setVolume=function(value){this.creative.volume.update(value)},AdController.prototype.setAutoResize=function(value){value?this.resizeController.setAutomatic():this.resizeController.setManual()},AdController.prototype.init=function(){var _this=this;if(bnt.logger.debug("controller.init"),!this.rendered){if(this.rendered=!0,this.creative&&this.element){bnt.get(bnt.SignalController).init(),this.resizeController.init(),this.stateChangeDetector.init(),this.renderer=new bnt.CreativeRenderer,this.resizeController.start();var initPr_1=new bnt.Promise;return bnt.TeadsPlayerAddons.apiProxy.addObserver(function(api){_this.scrollController.init(api),bnt.initIsMobile(api).map(function(){_this.renderer.init(),_this.renderer.load().map(function(_){try{bnt.SoundIconManager.getInstance().init(_this.creative)}catch(e){console.warn("AdController: Error initializing SoundIconManager:",e)}initPr_1.succeed(void 0)})})}),initPr_1.future}var err=new Error('"Controller is not configured " + this.creative + " " + this.element');throw this.onerror.update(err),err}bnt.logger.debug("controller not rendered")},AdController.prototype.start=function(){var _this=this;if(bnt.logger.debug("AdController start"),this.rendered)return this.renderer.render(this.element).flatMap(function(){return _this.onstart.update(void 0),_this.renderer.showCreative()});var err=new Error("Controller is not rendered");throw this.onerror.update(err),err},AdController.prototype.closeAd=function(){var _this=this;return bnt.Promise.asyncFulfilledWith(null).future.flatMap(function(){return _this.renderer.destroyCreative()}).map(function(){return bnt.get(bnt.BannerStage)&&_this.collapse()}).map(function(){return _this.ondestroy.update(void 0)})},AdController.prototype.pause=function(){var _this=this;return this.creative.suspend().map(function(){return _this.onsuspend.update(void 0)})},AdController.prototype.play=function(){var _this=this;return this.creative.play().map(function(){return _this.onplay.update(void 0)})},AdController.prototype.suspend=function(){var _this=this;return this.creative.suspend().map(function(){return _this.onsuspend.update(void 0)})},AdController.prototype.pause_pause=function(){var _this=this;return this.creative.pause().map(function(){return _this.onpause.update(void 0)})},AdController.prototype.resume=function(){var _this=this;return this.creative.resume().map(function(){return _this.onresume.update(void 0)})},AdController.prototype.resize=function(size){bnt.logger.debug("AdController resize",JSON.stringify(size)),this.fullscreen.update("fullscreen"===size.viewMode),bnt.get(bnt.ManualResizeStrategy)&&bnt.get(bnt.ManualResizeStrategy).update(size)},AdController.prototype.clickthru=function(url){var _this=this;getClickThruUrl(url).addObserver(function(clickThruUrl){clickThruUrl&&(_this.onclickthru.update(bnt.TeadsTracking.replaceTeadsMacro(bnt.net.cacheBuster(clickThruUrl))),_this.sendAdClickThru(clickThruUrl))})},AdController.prototype.trackPixel=function(uri){bntTracking.trackPixel(uri)},AdController.prototype.expand=function(){var _this=this,bannerStage=bnt.get(bnt.BannerStage);bannerStage&&!this.expanding&&(this.expanding=!0,bannerStage.hideStage().onSuccess(function(){bnt.set(bnt.State,_this.stateChangeDetector.getState()),_this.desiredExpandState.update({expanded:!0})}))},AdController.prototype.collapse=function(){var _this=this,bannerStage=bnt.get(bnt.BannerStage);bannerStage&&!this.collapsing&&(this.collapsing=!0,bnt.get(bnt.MainStage).hideStage().onSuccess(function(){bnt.set(bnt.State,bannerStage.getState()),_this.desiredExpandState.update({expanded:!1})}))},AdController.prototype.toggleExpand=function(){this.expanded?this.collapse():this.expand()},AdController.prototype.expandPerformed=function(state){this.expanded=state,this.expanded?(bnt.get(bnt.MainStage).showStage(),this.collapsing=!1):(bnt.get(bnt.BannerStage).showStage(),this.expanding=!1)},AdController.prototype.hideSoundIcon=function(){bnt.SoundIconManager.getInstance().suppressSoundIcon()},__decorate([bnt.Action({actionOf:bnt.Creative,allowed:function(interaction,creative,screen){return creative.bannerScreen&&screen!=creative.bannerScreen||!creative.bannerScreen}}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",Object)],AdController.prototype,"closeAd",null),__decorate([bnt.Action({actionOf:bnt.Creative,allowed:function(interaction){return"onclick"==interaction.triggerName}},"url"),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",void 0)],AdController.prototype,"clickthru",null),__decorate([bnt.Action({actionOf:bnt.Creative},"url"),__metadata("design:type",Function),__metadata("design:paramtypes",[String]),__metadata("design:returntype",void 0)],AdController.prototype,"trackPixel",null),__decorate([bnt.Action({actionOf:bnt.Creative,allowed:function(interaction,creative,screen){return creative.bannerScreen&&screen==creative.bannerScreen}}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],AdController.prototype,"expand",null),__decorate([bnt.Action({actionOf:bnt.Creative,allowed:function(interaction,creative,screen){return creative.bannerScreen&&screen!=creative.bannerScreen}}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],AdController.prototype,"collapse",null),__decorate([bnt.Action({actionOf:bnt.Creative,allowed:function(_interaction,_creative,_c,_eos,_element,state){var _a;return null!==(_c=null===(_c=null===(_a=null==_c?void 0:_c.deepGetEosByType)||void 0===_a?void 0:_a.call(_c,bnt.Video))||void 0===_c?void 0:_c.some(function(config){config=config.element.getConfig(state);return null==config?void 0:config.soundIconVisible}))&&void 0!==_c&&_c}}),__metadata("design:type",Function),__metadata("design:paramtypes",[]),__metadata("design:returntype",void 0)],AdController.prototype,"hideSoundIcon",null),AdController}();bnt.AdController=AdController}(bnt=bnt||{}),function(bnt){var VideoSlotRenderer=function(_super){function VideoSlotRenderer(_this){_this=_super.call(this,_this)||this;if(null!==VideoSlotRenderer_1.instance)throw new Error("Can't run more instances of VideoSlotRenderer of it's subclasses! => ".concat(VideoSlotRenderer_1.instance));return VideoSlotRenderer_1.instance=_this}var VideoSlotRenderer_1;return __extends(VideoSlotRenderer,_super),(VideoSlotRenderer_1=VideoSlotRenderer).prototype.preloadAssets=function(){this.videoElement=bnt.AdController.instance.videoSlot,this.coverElement=document.createElement("img"),bnt.get(bnt.net.Monitor).monitorHtmlElementLoad(this.coverElement),this.containerElement=this.htmlElement=document.createElement("div"),this.domElementReady.update(void 0),this.loadVideoSrc(),this.loadCoverSrc()},VideoSlotRenderer.prototype.populateElements=function(target){this.htmlElement.appendChild(this.coverElement),target.appendChild(this.containerElement)},VideoSlotRenderer.prototype.elementDestroyImpl=function(){return this.videoElement&&(this.videoElement.src=""),this.containerElement&&this.containerElement.parentNode&&this.containerElement.parentNode.removeChild(this.containerElement),this.unregisterAllFromElement(),bnt.Promise.fulfilledWith(null).future},VideoSlotRenderer.prototype.getClickTarget=function(){return this.containerElement},VideoSlotRenderer.instance=null,VideoSlotRenderer=VideoSlotRenderer_1=__decorate([bnt.RendererOf(bnt.Video,function(video){var config=video.getConfig(bnt.get(bnt.State)),videoSlot=bnt.get(bnt.AdController).videoSlot;return bnt.get(bnt.Creative).firstScreen().getBottomElementByType(bnt.Video)==video&&videoSlot&&!bnt.isVast(config.src)&&null===VideoSlotRenderer.instance},30),__metadata("design:paramtypes",[bnt.Video])],VideoSlotRenderer)}(bnt.BaseVideoRenderer);bnt.VideoSlotRenderer=VideoSlotRenderer}(bnt=bnt||{}),function(bnt){var TeadsVideoSlotRenderer=function(_super){function TeadsVideoSlotRenderer(video){return _super.call(this,video)||this}return __extends(TeadsVideoSlotRenderer,_super),TeadsVideoSlotRenderer.prototype.preloadAssets=function(){this.videoElement=bnt.AdController.instance.videoSlot,this.coverElement=document.createElement("img"),bnt.get(bnt.net.Monitor).monitorHtmlElementLoad(this.coverElement),this.containerElement=this.htmlElement=document.createElement("div"),this.domElementReady.update(void 0),this.loadVideoSrc(),this.loadCoverSrc()},TeadsVideoSlotRenderer.prototype.populateElements=function(target){this.containerElement.appendChild(this.videoElement),this.containerElement.appendChild(this.coverElement),target.appendChild(this.containerElement),bnt.TeadsPlayerAddons.apiProxy.value&&bnt.TeadsPlayerAddons.fixVideoSlotSize(this.video)},__decorate([bnt.Mixin(bnt.WithPan),bnt.RendererOf(bnt.Video,function(isBottomMostVideo){bnt.get(bnt.Creative);var videoSlot=bnt.get(bnt.AdController).videoSlot,videosOnMainScreen=bnt.get(bnt.Creative).firstScreen(),isOnMainScreen=videosOnMainScreen.deepGetEos(isBottomMostVideo)||!1,videosOnMainScreen=videosOnMainScreen.deepGetEosByType(bnt.Video),isBottomMostVideo=isOnMainScreen&&(1==videosOnMainScreen.length||videosOnMainScreen[videosOnMainScreen.length-1].element==isBottomMostVideo);return isOnMainScreen&&isBottomMostVideo&&videoSlot&&videoSlot.nodeType==Node.ELEMENT_NODE&&bnt.TeadsPlayerAddons.apiProxy.value&&null===bnt.VideoSlotRenderer.instance},10),__metadata("design:paramtypes",[bnt.Video])],TeadsVideoSlotRenderer)}(bnt.VideoSlotRenderer);bnt.TeadsVideoSlotRenderer=TeadsVideoSlotRenderer}(bnt=bnt||{}),function(bnt){var LKQDVideoSlotRenderer=function(_super){function LKQDVideoSlotRenderer(video){return _super.call(this,video)||this}return __extends(LKQDVideoSlotRenderer,_super),LKQDVideoSlotRenderer.prototype.preloadAssets=function(){this.videoElement=bnt.AdController.instance.videoSlot,this.coverElement=document.createElement("img"),bnt.get(bnt.net.Monitor).monitorHtmlElementLoad(this.coverElement),this.domElementReady.update(void 0),this.loadVideoSrc(),this.loadCoverSrc()},LKQDVideoSlotRenderer.prototype.populateElements=function(target){this.videoElement.style.width="",this.videoElement.style.height="",this.videoElement.classList.remove("lkqdvideo"),this.containerElement=this.htmlElement=bnt.createElement("div",target),this.containerElement.appendChild(this.videoElement),this.containerElement.appendChild(this.coverElement)},__decorate([bnt.Mixin(bnt.WithPan),bnt.RendererOf(bnt.Video,function(isBottomMostVideo){bnt.get(bnt.Creative);var videoSlot=bnt.get(bnt.AdController).videoSlot,videosOnMainScreen=bnt.get(bnt.Creative).firstScreen(),isOnMainScreen=videosOnMainScreen.deepGetEos(isBottomMostVideo)||!1,videosOnMainScreen=videosOnMainScreen.deepGetEosByType(bnt.Video),isBottomMostVideo=isOnMainScreen&&(1==videosOnMainScreen.length||videosOnMainScreen[videosOnMainScreen.length-1].element==isBottomMostVideo);return isOnMainScreen&&isBottomMostVideo&&"1"==bnt.QueryParams.get("lkqd")&&null!=videoSlot&&null===bnt.VideoSlotRenderer.instance},20),__metadata("design:paramtypes",[bnt.Video])],LKQDVideoSlotRenderer)}(bnt.VideoSlotRenderer);bnt.LKQDVideoSlotRenderer=LKQDVideoSlotRenderer}(bnt=bnt||{}),function(bnt){var VastTrackingEvent=function(){function VastTrackingEvent(){}return VastTrackingEvent.error="error",VastTrackingEvent.click="click",VastTrackingEvent.pause="pause",VastTrackingEvent.resume="resume",VastTrackingEvent.skip="skip",VastTrackingEvent.creativeView="creativeView",VastTrackingEvent.start="start",VastTrackingEvent.firstQuartile="firstQuartile",VastTrackingEvent.midpoint="midpoint",VastTrackingEvent.thirdQuartile="thirdQuartile",VastTrackingEvent.complete="complete",VastTrackingEvent.impression="impression",VastTrackingEvent.close="close",VastTrackingEvent.progress="progress",VastTrackingEvent.mute="mute",VastTrackingEvent.unmute="unmute",VastTrackingEvent.rewind="rewind",VastTrackingEvent.fullscreen="fullscreen",VastTrackingEvent.exitFullscreen="exitFullscreen",VastTrackingEvent.expand="expand",VastTrackingEvent.collapse="collapse",VastTrackingEvent.acceptInvitationLinear="acceptInvitationLinear",VastTrackingEvent.acceptInvitation="acceptInvitation",VastTrackingEvent.closeLinear="closeLinear",VastTrackingEvent.noAd="noAd",VastTrackingEvent.noLinearAd="noLinearAd",VastTrackingEvent.customClicks="customClicks",VastTrackingEvent.billable="billable",VastTrackingEvent}();bnt.VastTrackingEvent=VastTrackingEvent;var VastAdaptor=function(_super){function VastAdaptor(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(VastAdaptor,_super),VastAdaptor.prototype.loadImpl=function(){var _this=this;return this.preloadAssets(),bnt.get(bnt.StateChangeDetector).stateUpdated.addObserver(function(){return _this.updateStateConfigVideoMetadata()}),this.vastPromise.future},VastAdaptor.prototype.loadVideoSrc=function(){this.vastPromise=new bnt.Promise;var vUrl=bnt.get(bnt.State),vUrl=this.video.getConfig(vUrl),vUrl=bnt.getVast(vUrl.src);this.videoElement&&vUrl&&this.lastVastPlayed!=vUrl&&(this.lastVastPlayed&&(this.teadsTracker&&this.teadsTracker.deinit(),this.teadsTracker=null,this.linearAd=null,this.playerConfig=null,this.mediaFile=null,this.teadsPlayer=null),this.lastVastPlayed=vUrl,this.teadsLibWin?this.initVastPlayer():this.loadVASTPlayer())},VastAdaptor.prototype.loadVASTPlayer=function(){var _this=this;bnt.net.downloadScript(VAST_PLAYER,!1).map(function(state){_this.teadsLibWin=state;state=bnt.get(bnt.State),_this.video.getConfig(state);_this.initVastPlayer()})},VastAdaptor.prototype.initVastPlayer=function(responsive,template,customVideo){var _this=this;void 0===template&&(template=""),this.playerConfig={path:"../dist",debug:!0,width:(responsive=void 0===responsive?!1:responsive)?null:1280,useCustomVideo:customVideo=void 0===customVideo?!1:customVideo,ui:void 0},template&&(this.playerConfig.ui={name:template,config:{components:{clicktoplay:{disable:!0},clickbutton:{disable:!0},endscreen:{disable:!0}}}}),this.teadsPlayer=new this.teadsLibWin.teads.player.VASTPlayer(null,this.playerConfig),this.teadsPlayer.loadVast(this.lastVastPlayed,function(linearAd){return _this.onVastReady(linearAd)},function(err){return console.error(err)})},VastAdaptor.prototype.onVastReady=function(linearAd){var _this=this;this.linearAd=linearAd,this.teadsLibWin.teads.player.MediaFileHelper.getOptimalMediaFiles(this.linearAd.mediaFiles,null,function(mediaFiles){mediaFiles.length?(_this.mediaFile=mediaFiles[0],_this.videoElement.src!=_this.mediaFile.url&&(_this.videoElement.src=_this.mediaFile.url),_this.videoElement.addEventListener("durationchange",function(){return _this.updateStateConfigVideoMetadata()}),_this.vastPromise.succeed(void 0),_this.video.onclick.hasObservers()||_this.linearAd.clickThrough&&_this.video.onclick.addEventListener(function(){adController.clickthru(_this.linearAd.clickThrough[0]),bntTracking.trackEvent("".concat(_this.video.elementId,": onclick"),null)}),_this.trackVastEvents(_this.video)):_this.vastPromise.fail(new Error("No media file compatible with context"))},this.teadsLibWin.teads.player.PLAYER_TYPE.HTML5)},VastAdaptor.prototype.updateStateConfigVideoMetadata=function(){var panMechanic;this.videoElement&&this.videoElement.videoWidth&&this.videoElement.videoHeight&&this.videoElement.duration&&(panMechanic=bnt.get(bnt.State),(panMechanic=this.video.getConfig(panMechanic)).videoWidth=this.videoElement.videoWidth,panMechanic.videoHeight=this.videoElement.videoHeight,panMechanic.videoDuration=this.videoElement.duration,(panMechanic=this.getVideoElementWithPan())&&panMechanic.forceUpdateLastConfig())},VastAdaptor.prototype.trackVastEvents=function(video){var tracker=new this.teadsLibWin.teads.player.VASTEventTracker(this.linearAd,this.playerConfig),trackStart=function(){tracker.track(VastTrackingEvent.impression),tracker.track(VastTrackingEvent.start),tracker.track(VastTrackingEvent.creativeView),video.onplay.removeObserver(trackStart),video.onplay.addObserver(trackResume)},trackResume=function(){tracker.track(VastTrackingEvent.resume)},lastVolume=video.volume.value,quartiles=[!1,!1,!1,!1];video.onplay.addObserver(trackStart),video.onpause.addObserver(function(){tracker.track(VastTrackingEvent.pause)}),video.timeMillisec.addObserver(function(time){video.timeMillisec.value<=0||video.duration.value<=0||(.75<=video.timeMillisec.value/video.duration.value&&!quartiles[2]&&(quartiles[2]=!0,tracker.track(VastTrackingEvent.thirdQuartile)),.5<=video.timeMillisec.value/video.duration.value&&!quartiles[1]&&(quartiles[1]=!0,tracker.track(VastTrackingEvent.midpoint)),.25<=video.timeMillisec.value/video.duration.value&&!quartiles[0]&&(quartiles[0]=!0,tracker.track(VastTrackingEvent.firstQuartile)))}),video.onend.addObserver(function(){quartiles[3]||(quartiles[3]=!0,tracker.track(VastTrackingEvent.complete))}),video.volume.addObserver(function(volume){volume&&!lastVolume?tracker.track(VastTrackingEvent.unmute):!volume&&lastVolume&&tracker.track(VastTrackingEvent.mute),lastVolume=volume}),video.onclick.addObserver(function(){tracker.track(VastTrackingEvent.click)}),adController.fullscreen.addObserver(function(fullscreenOn){fullscreenOn?tracker.track(VastTrackingEvent.fullscreen):tracker.track(VastTrackingEvent.exitFullscreen)})},VastAdaptor}(bnt.BaseVideoRenderer);bnt.VastAdaptor=VastAdaptor}(bnt=bnt||{}),function(bnt){var VideoRenderer=function(_super){function VideoRenderer(video){return _super.call(this,video)||this}return __extends(VideoRenderer,_super),VideoRenderer.prototype.preloadAssets=function(){this.videoElement=document.createElement("video"),this.videoElement.setAttribute("webkit-playsinline","true"),this.videoElement.setAttribute("playsinline","true"),this.coverElement=document.createElement("img"),bnt.get(bnt.net.Monitor).monitorHtmlElementLoad(this.coverElement),this.containerElement=this.htmlElement=document.createElement("div"),this.domElementReady.update(void 0),this.loadVideoSrc(),this.loadCoverSrc()},VideoRenderer.prototype.populateElements=function(target){this.htmlElement.appendChild(this.videoElement),this.htmlElement.appendChild(this.coverElement),target.appendChild(this.containerElement)},VideoRenderer.prototype.elementDestroyImpl=function(){return this.containerElement&&this.containerElement.parentNode&&this.containerElement.parentNode.removeChild(this.containerElement),bnt.Promise.fulfilledWith(null).future},__decorate([bnt.Mixin(bnt.WithPan),bnt.RendererOf(bnt.Video),__metadata("design:paramtypes",[bnt.Video])],VideoRenderer)}(bnt.BaseVideoRenderer);bnt.VideoRenderer=VideoRenderer}(bnt=bnt||{}),function(bnt){var GroupRenderer=function(_super){function GroupRenderer(group){var _this=_super.call(this,group)||this;return _this.group=group,_this}return __extends(GroupRenderer,_super),GroupRenderer.prototype.initImpl=function(){var _this=this;this.group.eos.forEach(function(eos,index){eos.initZIndex(_this.group.eos.length-index),bnt.ElementRendererRegistry.rendererFor(eos.element).init()})},GroupRenderer.prototype.loadImpl=function(){var futures=this.group.eos.map(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).load()});return bnt.Promise.forAll(futures)},GroupRenderer.prototype.elementRenderImpl=function(target){var _this=this;this.divElement=document.createElement("div"),this.domElementReady.update(void 0);var futures=this.group.eos.map(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).render(_this.divElement)});return bnt.Promise.forAll(futures).map(function(){return _this.divElement})},GroupRenderer.prototype.elementDestroyImpl=function(){var _this=this;this.divElement&&this.divElement.parentNode&&this.divElement.parentNode.removeChild(this.divElement);var futures=this.group.eos.map(function(eos){return bnt.ElementRendererRegistry.rendererFor(eos.element).destroy()});return bnt.Promise.forAll(futures).map(function(){return _this.divElement})},GroupRenderer.prototype.configureForScreen=function(screen,eos){_super.prototype.configureForScreen.call(this,screen,eos),this.element.eos.forEach(function(e){return bnt.ElementRendererRegistry.rendererFor(e.element).configureForScreen(screen,e)})},GroupRenderer.prototype.screenShowing=function(animation){_super.prototype.screenShowing.call(this,animation),this.element.eos.map(function(e){return bnt.ElementRendererRegistry.rendererFor(e.element).screenShowing(animation)})},GroupRenderer.prototype.screenHiding=function(animation){_super.prototype.screenHiding.call(this,animation),this.element.eos.map(function(e){return bnt.ElementRendererRegistry.rendererFor(e.element).screenHiding(animation)})},GroupRenderer.prototype.show=function(animated){return this.element.forEachEos(function(e){return bnt.ElementRendererRegistry.rendererFor(e.element).show(!1)}),_super.prototype.show.call(this,animated)},GroupRenderer.prototype.hide=function(animated){return this.element.forEachEos(function(e){return bnt.ElementRendererRegistry.rendererFor(e.element).hide(!1)}),_super.prototype.hide.call(this,animated)},GroupRenderer.prototype.doShowAnimation=function(animations){var a=_super.prototype.doShowAnimation.call(this,animations),animations=this.element.eos.map(function(e){return[e,bnt.ElementRendererRegistry.rendererFor(e.element)]}).filter(function(e){var _b=__read(e,2),e=_b[0];return _b[1].screenVisible&&e.element.visible.value}).map(function(r){r=__read(r,2),r[0],r=r[1];return r.doShowAnimation(!!r.lastEosConfig.onShow.name)});return a=new bnt.CompoundAnimation(__spreadArray([a],__read(animations),!1))},GroupRenderer.prototype.doHideAnimation=function(animations){var a=_super.prototype.doHideAnimation.call(this,animations),animations=this.element.eos.map(function(e){return[e,bnt.ElementRendererRegistry.rendererFor(e.element)]}).filter(function(e){var _b=__read(e,2),e=_b[0];return _b[1].screenVisible&&e.element.visible.value}).map(function(r){r=__read(r,2),r[0],r=r[1];return r.doHideAnimation(!!r.lastEosConfig.onHide.name)});return a=new bnt.CompoundAnimation(__spreadArray([a],__read(animations),!1))},GroupRenderer.prototype.applyScreenConfig=function(state,config){_super.prototype.applyScreenConfig.call(this,state,config),this.group.eos.forEach(function(eosConfig){var renderer=bnt.ElementRendererRegistry.rendererFor(eosConfig.element),eosConfig=eosConfig.getConfig(state);renderer.applyScreenConfig(state,eosConfig)})},GroupRenderer.prototype.applyElementConfig=function(futures){futures.visible!=this.element.visible.value&&this.element.visible.update(futures.visible),this.divElement&&bnt.style(this.divElement,{width:bnt.px(futures.width),height:bnt.px(futures.height),opacity:futures.opacity,transform:"rotate("+(futures.angle||0)+"deg)"});futures=this.group.eos.map(function(config){var renderer=bnt.ElementRendererRegistry.rendererFor(config.element),config=config.element.getConfig(bnt.get(bnt.State));return renderer.applyElementConfig(config)});return bnt.Promise.forAll(futures)},GroupRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.divElement,"click",this.group.onclick,!0),this.registerFor(this.divElement,"mouseenter",this.group.onmouseenter),this.registerFor(this.divElement,"mouseleave",this.group.onmouseleave)},GroupRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.divElement,"click"),this.unregisterFor(this.divElement,"mouseenter"),this.unregisterFor(this.divElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.Group),__metadata("design:paramtypes",[bnt.Group])],GroupRenderer)}(bnt.ElementRenderer);bnt.GroupRenderer=GroupRenderer}(bnt=bnt||{}),function(bnt){function rotatePositionAroundCenter(offsetY,center,sin){if(0===sin)return{x:offsetY.x,y:offsetY.y};var offsetX=sin/180*Math.PI,cos=Math.cos(offsetX),sin=Math.sin(offsetX),offsetX=offsetY.x-center.x,offsetY=offsetY.y-center.y;return{x:offsetX*cos-offsetY*sin+center.x,y:offsetX*sin+offsetY*cos+center.y}}function readAngle(angle){angle=null==angle?void 0:angle.angle;return"number"==typeof angle?angle:0}function readDimension(config,value){value=null==config?void 0:config[value];return"number"==typeof value?value:0}bnt.rotatePositionAroundCenter=rotatePositionAroundCenter;var PositionHelper=function(){function PositionHelper(){}return PositionHelper.GetAbsolutePosition=function(screen,eos,transform){transform=PositionHelper.GetAbsoluteTransform(screen,eos,transform);return{x:transform.x,y:transform.y}},PositionHelper.GetAbsoluteTransform=function(eosConfig,eos,state){var path=eosConfig.getPath(eos);if(!path)return{x:0,y:0,angle:0};for(var eosConfig=eos.getConfig(state),transform={x:eosConfig.x,y:eosConfig.y,angle:readAngle(eos.element.getConfig(state))},i=path.length-1;0<=i;i--)transform=PositionHelper.composeWithGroup(transform,path[i],state);return transform},PositionHelper.composeWithGroup=function(descendantTransform,rotated,groupAngle){var groupEosConfig=rotated.getConfig(groupAngle),rotated=rotated.element.getConfig(groupAngle),groupAngle=readAngle(rotated),rotated=rotatePositionAroundCenter(descendantTransform,{x:readDimension(rotated,"width")/2,y:readDimension(rotated,"height")/2},groupAngle);return{x:rotated.x+groupEosConfig.x,y:rotated.y+groupEosConfig.y,angle:descendantTransform.angle+groupAngle}},PositionHelper}();bnt.PositionHelper=PositionHelper}(bnt=bnt||{}),function(bnt){var ResizeController=function(){function ResizeController(){this.resize=new bnt.Observable}return ResizeController.prototype.setAutomatic=function(){this.changeStrategy(new bnt.WindowListenerResizeStrategy)},ResizeController.prototype.setManual=function(){this.changeStrategy(new bnt.ManualResizeStrategy)},ResizeController.prototype.changeStrategy=function(strategy){this.strategy&&this.strategy.dispose(),this.strategy=strategy,this.strategy.init(this)},ResizeController.prototype.init=function(){var _this=this;this.strategy||(this.strategy=new bnt.ResizeStrategy.defaultStrategy),this.strategy.init(this),this.resize.addObserver(function(dim){return _this.previous=dim})},ResizeController.prototype.start=function(){this.strategy.start()},__decorate([bnt.Singleton],ResizeController)}();bnt.ResizeController=ResizeController}(bnt=bnt||{}),function(bnt){var ManualResizeStrategy=function(){function ResizeStrategy(){}return ResizeStrategy.prototype.dispose=function(){},ResizeStrategy}(),WindowListenerResizeStrategy=function(_super){function WindowListenerResizeStrategy(){var _this=_super.apply(this,__spreadArray([],__read(arguments),!1))||this;return _this.useOuterDimensions=null,_this.resizeHandler=function(){var dim={width:Math.max(document.documentElement.clientWidth,(_this.useOuterDimensions?_this.useOuterDimensions.width:window.innerWidth)||0),height:Math.max(document.documentElement.clientHeight,(_this.useOuterDimensions?_this.useOuterDimensions.height:window.innerHeight)||0)};_this.controller.resize.update(dim)},_this}return __extends(WindowListenerResizeStrategy,_super),WindowListenerResizeStrategy.prototype.init=function(controller){bnt.set(WindowListenerResizeStrategy,this),this.controller=controller,window?window.addEventListener("resize",this.resizeHandler):bnt.logger.error("This strategy cannot be applied without a <window> object")},WindowListenerResizeStrategy.prototype.start=function(){this.resizeHandler()},WindowListenerResizeStrategy.prototype.dispose=function(){window.removeEventListener("resize",this.resizeHandler)},WindowListenerResizeStrategy}(bnt.ResizeStrategy=ManualResizeStrategy);bnt.WindowListenerResizeStrategy=WindowListenerResizeStrategy,ManualResizeStrategy.defaultStrategy=WindowListenerResizeStrategy;ManualResizeStrategy=function(_super){function ManualResizeStrategy(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(ManualResizeStrategy,_super),ManualResizeStrategy.prototype.init=function(controller){this.controller=controller,bnt.set(ManualResizeStrategy,this),bnt.logger.debug("Ad resize is handled by the container.")},ManualResizeStrategy.prototype.start=function(){},ManualResizeStrategy.prototype.update=function(dimension){this.controller.resize.update(dimension)},ManualResizeStrategy}(ManualResizeStrategy);bnt.ManualResizeStrategy=ManualResizeStrategy}(bnt=bnt||{}),function(bnt){var PixelType;!function(PixelType){PixelType[PixelType.js=0]="js",PixelType[PixelType.url=1]="url",PixelType[PixelType.script=2]="script",PixelType[PixelType.img=3]="img"}(PixelType=PixelType||{});var TrackingUnit=function(){function TrackingUnit(config){var _a,_this=this;this.config=config,this.started=!1,this.quartiles=[!1,!1,!1,!1,!1],this.samplingRates=((_a={})[bnt.TrackingSamplingLevel.Off]=0,_a[bnt.TrackingSamplingLevel.Auto]=.1,_a[bnt.TrackingSamplingLevel.Full]=1,_a),this.teadsTracking=new bnt.TeadsTracking(config),bnt.TeadsPlayerAddons.apiProxy.addObserver(function(apiProxy){apiProxy?(apiProxy.getContextData().map(function(contextData){_this.teadsTracking.setContext(contextData&&contextData.tracking),_this.teadsTracking.setGDPR(contextData&&contextData.gdpr)}),apiProxy.getTeadsInfo().map(function(cids){_this.teadsTracking.setTeadsInfo(cids)})):(_this.teadsTracking.setContext(null),_this.teadsTracking.setGDPR(null),_this.teadsTracking.setTeadsInfo(null))}),bnt.logger.debug(config)}return TrackingUnit.prototype.track=function(events){var _this=this;Object.keys(events).map(function(key){var event="string"==typeof events[key].type?events[key]:{listener:events[key],type:"info"};event.listener.addEventListener(function(){_this.trackEvent(key,event.type)})})},TrackingUnit.prototype.trackPixel=function(pixel,type){if(pixel)switch(type=type||"url",pixel=pixel.trim(),PixelType[type]){case PixelType.url:this.urlRequest(bnt.TeadsTracking.replaceTeadsMacro(pixel));break;case PixelType.js:bnt.TrackingUnit.trackingScript(pixel);break;case PixelType.script:var imgSrc=/<script.*?(src=\"(.+?)\")*.*?>((.|\n|\r|\r\n)*)<\/script>/gim.exec(pixel),scriptUrl=imgSrc[2],imgSrc=imgSrc[3];bnt.TrackingUnit.trackingScript(scriptUrl,imgSrc);break;case PixelType.img:imgSrc=/<img.+?src=[\"'](.+?)[\"'].*?>/.exec(pixel)[1];this.urlRequest(imgSrc)}},TrackingUnit.prototype.trackEvent=function(name,value){this.trackEvents?(bnt.logger.warn('Tracked event: "'.concat(name,'"')),this.trackTeadsEvent(name,value)):bnt.logger.warn('Tracking suppressed. Tracked event: "'.concat(name,'"'))},TrackingUnit.prototype.trackTeadsEvent=function(name,value){this.teadsTracking.send(value?"".concat(name,"-").concat(value):name)},TrackingUnit.prototype.trackVideoQuartiles=function(video,videoName){!function(video,name,tracker){var v=video,trk=tracker,vName=name,onstart=!1,onfirstq=!1,onmidpoint=!1,onthirdq=!1,onend=!1;v.timeMillisec.addObserver(function(){v.timeMillisec.value<=0||v.duration.value<=0||(.75<=v.timeMillisec.value/v.duration.value&&!onthirdq&&(onthirdq=!0,trk.trackEvent("+#"+videoName+": thirdquartile")),.5<=v.timeMillisec.value/v.duration.value&&!onmidpoint&&(onmidpoint=!0,trk.trackEvent("+#"+vName+": midpoint")),.25<=v.timeMillisec.value/v.duration.value&&!onfirstq&&(onfirstq=!0,trk.trackEvent("+#"+vName+": firstquartile")),onstart||(onstart=!0,trk.trackEvent("+#"+vName+": start")))}),v.onend.addObserver(function(){onend||(onend=!0,trk.trackEvent("+#"+videoName+" complete"))})}(video,videoName,this)},TrackingUnit.prototype.trackCreative=function(creative){var _this=this,samplingMessage=this.samplingRates[creative.config.trackingSamplingLevel];this.trackEvents=creative.config.trackingSamplingLevel!=bnt.TrackingSamplingLevel.Off&&Math.random()<=samplingMessage;var samplingFactor=1/samplingMessage;this.trackEvents||(samplingMessage=creative.config.trackingSamplingLevel===bnt.TrackingSamplingLevel.Off?"Off":"1 in ".concat(samplingFactor),bnt.logger.warn("All events will be suppressed from triggering this session. Sampling rate is ".concat(samplingMessage))),this.teadsTracking.setSamplingFactor(samplingFactor),this.trackEvent("load"),(this.creative=creative).getController().onclickthru.addObserver(function(){return _this.trackEvent("completionLayer")}),creative.getController().onstart.addObserver(function(){return _this.trackCreativeStart()}),creative.getController().desiredExpandState.addObserver(function(state){return _this.trackCreativeExpand(state)}),creative.timeMillisec.addObserver(function(){return _this.trackCreativeQuartiles()}),creative.onend.addObserver(function(){return _this.trackCreativeEnd()}),creative.onscreenchange.addObserver(function(to){var from=to.from,to=to.to;return _this.handlerScreenChange(from,to)})},TrackingUnit.prototype.trackCreativeStart=function(){this.trackEvent("show"),this.started=!0},TrackingUnit.prototype.handlerScreenChange=function(fromScreen,toScreen){this.started&&toScreen&&this.trackEvent("+#Screen changed to "+toScreen.name)},TrackingUnit.prototype.trackCreativeExpand=function(evt){evt=evt.expanded?"+Creative expand":"+Creative collapse";this.trackEvent(evt)},TrackingUnit.prototype.trackCreativeQuartiles=function(){var time,percent_1;this.creative.onmainscreen.value&&(time=this.creative.timeMillisec.value,percent_1=this.creative.duration.value,time<=0||percent_1<=0||(.75<=(percent_1=time/percent_1)&&!this.quartiles[3]&&(this.quartiles[3]=!0,this.trackEvent("AdVideoThirdQuartile")),.5<=percent_1&&!this.quartiles[2]&&(this.quartiles[2]=!0,this.trackEvent("AdVideoMidpoint")),.25<=percent_1&&!this.quartiles[1]&&(this.quartiles[1]=!0,this.trackEvent("AdVideoFirstQuartile")),this.quartiles[0]||(this.quartiles[0]=!0,this.trackEvent("AdVideoStart"))))},TrackingUnit.prototype.trackCreativeEnd=function(){this.creative.onmainscreen.value&&(this.quartiles[4]||(this.quartiles[4]=!0,this.trackEvent("AdVideoComplete")))},Object.defineProperty(TrackingUnit.prototype,"canTrack",{get:function(){return this.config.uid&&this.config.cid},enumerable:!1,configurable:!0}),TrackingUnit.prototype.urlRequest=function(url){return url=bnt.net.cacheBuster(url),this.canTrack?bnt.net.triggerPixel(url):bnt.Promise.fulfilledWith(!0).future},TrackingUnit.trackingScript=function(scriptUrl,scriptBody){void 0===scriptBody&&(scriptBody="");function getSrcAttribute(scriptUrl){return scriptUrl?' src="'+scriptUrl+'" ':""}var frame=document.createElement("IFRAME");frame.setAttribute("frameBorder","0"),frame.contentWindow.document.body.style.borderWidth="0",frame.contentWindow.document.body.style.pointerEvents="none",/iPad;/g.test(navigator.userAgent)?frame.contentDocument.writeln('<script type="text/javascript" '+getSrcAttribute(scriptUrl)+">"+scriptBody+"<\/script>"):frame.src="javascript:document.innerHTML=\"<script type='text/javascript' "+getSrcAttribute(scriptUrl).replace(new RegExp('"',"g"),'\\"')+">"+scriptBody.replace(new RegExp('"',"g"),'\\"')+'<\/script>"',document.body.appendChild(frame)},__decorate([bnt.Action({actionOf:TrackingUnit},"track-event-string"),__metadata("design:type",Function),__metadata("design:paramtypes",[String,Object]),__metadata("design:returntype",void 0)],TrackingUnit.prototype,"trackEvent",null),TrackingUnit}();bnt.TrackingUnit=TrackingUnit}(bnt=bnt||{}),function(bnt){var TeadsTracking=function(){function TeadsTracking(config,evtNamePrevix){void 0===evtNamePrevix&&(evtNamePrevix="studio_");var _this=this;this.config=config,this.evtNamePrevix=evtNamePrevix,this.initialized=new bnt.ObservableValue(void 0),this.prContext=new bnt.Promise,this.prGDPR=new bnt.Promise,this.prCampaignIds=new bnt.Promise,this.samplingFactor=1,bnt.Promise.forAll([this.prContext,this.prGDPR,this.prCampaignIds].map(function(pr){return pr.future})).map(function(){_this.setupTeadsInfo(),_this.initialized.update(!0)})}return TeadsTracking.prototype.setContext=function(teadsContext){TeadsTracking.teadsContext=teadsContext,this.prContext.succeed(!0)},TeadsTracking.prototype.setTeadsInfo=function(campaignIds){TeadsTracking.teadsInfo=campaignIds,this.prCampaignIds.succeed(!0)},TeadsTracking.prototype.setGDPR=function(gdpr){TeadsTracking.teadsGDPR=gdpr,this.prGDPR.succeed(!0)},TeadsTracking.prototype.setSamplingFactor=function(samplingFactor){this.samplingFactor=samplingFactor},TeadsTracking.prototype.send=function(action){var url,_this=this;if(this.initialized.value){try{url=this.buildUrl(action)}catch(er){return void bnt.logger.error("Something went wrong while building the pixel url",action,TeadsTracking.teadsContext,er)}this.isTrackingAllowed()?bnt.net.triggerPixel(url).map(function(success){success||bnt.logger.warn("Teads pixel failled: ".concat(url))}):bnt.logger.debug("Teads pixel:",url)}else this.initialized.addObserver(function(){return _this.send(action)})},TeadsTracking.prototype.isTrackingAllowed=function(){return!(!this.config.cid||!this.config.uid)},TeadsTracking.prototype.buildUrl=function(action){var trackedInfo=TeadsTracking.teadsContext&&TeadsTracking.teadsContext.studio_cid&&TeadsTracking.teadsContext.studio_cid.toString()||this.config&&this.config.cid,endpoint=bnt.get(bnt.State),trackedInfo={action:this.evtNamePrevix+action,studio_cid:trackedInfo,referer:document.referrer,ts:Date.now(),sf:this.samplingFactor.toFixed(0)};endpoint&&(trackedInfo.studio_canvas=endpoint.canvas.config.name,trackedInfo.studio_segment=endpoint.segment.config.name),this.addTeadsInfo(trackedInfo);endpoint=TeadsTracking.ENDPOINT;return"".concat(TeadsTracking.PROTOCOL,"//").concat(endpoint,"/track?").concat(bnt.net.serializeObjectAsURI(trackedInfo))},TeadsTracking.prototype.addTeadsInfo=function(trackedInfo){TeadsTracking.teadsTrackInfo.sid&&(trackedInfo.sid=TeadsTracking.teadsTrackInfo.sid),TeadsTracking.teadsTrackInfo.gid&&(trackedInfo.gid=TeadsTracking.teadsTrackInfo.gid),TeadsTracking.teadsTrackInfo.cid&&(trackedInfo.cid=TeadsTracking.teadsTrackInfo.cid),TeadsTracking.teadsTrackInfo.pid&&(trackedInfo.pid=TeadsTracking.teadsTrackInfo.pid),TeadsTracking.teadsTrackInfo.env&&(trackedInfo.env=TeadsTracking.teadsTrackInfo.env),TeadsTracking.teadsTrackInfo.slot&&(trackedInfo.slot=TeadsTracking.teadsTrackInfo.slot)},TeadsTracking.getTeadsTrackedInfo=function(contextName,apiName){return TeadsTracking.teadsContext&&TeadsTracking.teadsContext[contextName]?TeadsTracking.teadsContext[contextName]:apiName&&TeadsTracking.teadsInfo&&TeadsTracking.teadsInfo[apiName]?TeadsTracking.teadsInfo[apiName]:void 0},TeadsTracking.prototype.setupTeadsInfo=function(){TeadsTracking.teadsTrackInfo.sid=TeadsTracking.getTeadsTrackedInfo("sid","connectionId"),TeadsTracking.teadsTrackInfo.gid=TeadsTracking.getTeadsTrackedInfo("gid","insertionId"),TeadsTracking.teadsTrackInfo.cid=TeadsTracking.getTeadsTrackedInfo("cid","creativeId"),TeadsTracking.teadsTrackInfo.pid=TeadsTracking.getTeadsTrackedInfo("pid","placementId"),TeadsTracking.teadsTrackInfo.env=TeadsTracking.getTeadsTrackedInfo("env","environment"),TeadsTracking.teadsTrackInfo.slot=TeadsTracking.getTeadsTrackedInfo("slot","slotType"),TeadsTracking.teadsTrackInfo.wname=TeadsTracking.getTeadsTrackedInfo("wname"),TeadsTracking.teadsTrackInfo.wid=TeadsTracking.getTeadsTrackedInfo("wid"),TeadsTracking.teadsTrackInfo.idfa=TeadsTracking.getTeadsTrackedInfo("idfa"),TeadsTracking.teadsTrackInfo.auctid=TeadsTracking.getTeadsTrackedInfo("auctid"),TeadsTracking.teadsTrackInfo.ad_id=TeadsTracking.getTeadsTrackedInfo("ad_id"),TeadsTracking.teadsTrackInfo.ad_name=TeadsTracking.getTeadsTrackedInfo("ad_name"),TeadsTracking.teadsTrackInfo.device=TeadsTracking.getTeadsTrackedInfo("device"),TeadsTracking.teadsTrackInfo.gdpr=TeadsTracking.teadsGDPR?TeadsTracking.teadsGDPR.applies:"",TeadsTracking.teadsTrackInfo.gdpr_consent=TeadsTracking.teadsGDPR?TeadsTracking.teadsGDPR.consent:""},TeadsTracking.replaceTeadsMacro=function(url){return url.replace(TeadsTracking.MacroRegex,function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var macroValue=__read(args),macro=macroValue[1],macroValue=macroValue.slice(2),macroValue=(__read(macroValue.reverse()).slice(2).find(function(v){return!!v})||"").toLowerCase();if("timestamp"===macroValue)return Date.now().toString();macroValue=TeadsTracking.teadsTrackInfo[macroValue];return void 0!==macroValue?macroValue.toString():macro})},TeadsTracking.ENDPOINT="studio-t.teads.tv",TeadsTracking.PROTOCOL="https:",TeadsTracking.teadsTrackInfo={},TeadsTracking.GenericMacroRegex="(?:\\[([^\\]]+)])|(?:\\${([^}]+)})|(?:%5B(.+?)%5D)|(?:%24%7B(.+?)%7D)",TeadsTracking.GDPRMacroRegex="(?:\\[(GDPR)])|(?:\\${(GDPR)})|(?:%5B(GDPR)%5D)|(?:%24%7B(GDPR)%7D)",TeadsTracking.MacroRegexContent=[TeadsTracking.GDPRConsentMacroRegex="(?:\\[(GDPR_CONSENT)(?:_\\d+)])|(?:\\${(GDPR_CONSENT)(?:_\\d+)})|(?:%5B(GDPR_CONSENT)(?:_\\d+)%5D)|(?:%24%7B(GDPR_CONSENT)(?:_\\d+)%7D)",TeadsTracking.GDPRMacroRegex,TeadsTracking.GenericMacroRegex].join("|"),TeadsTracking.MacroRegex=new RegExp("(".concat(TeadsTracking.MacroRegexContent,")"),"gi"),TeadsTracking}();bnt.TeadsTracking=TeadsTracking}(bnt=bnt||{}),function(bnt){!function(net){function createScript(src,scriptContainer){scriptContainer=scriptContainer||document.documentElement;var scriptElement=document.createElement("script"),ret=new bnt.Promise;return scriptElement.addEventListener("load",function(){ret.succeed(scriptElement.ownerDocument.defaultView||scriptElement.ownerDocument.parentWindow)}),scriptElement.addEventListener("error",function(){ret.fail(null)}),scriptElement.setAttribute("src",src),scriptContainer.appendChild(scriptElement),ret.future}net.downloadScript=function(src,sameSandbox){return(sameSandbox=void 0===sameSandbox?!0:sameSandbox)?createScript(src):function(){var newSandbox=document.createElement("iframe");newSandbox.width="0px",newSandbox.height="0px";var pr=new bnt.Promise;return newSandbox.onload=function(){pr.succeed(newSandbox.contentWindow)},document.body.appendChild(newSandbox),pr.future}().flatMap(function(newSandboxWin){return createScript(src,newSandboxWin.document.documentElement)})},net.serializeObjectAsURI=function(obj){var i,parts=[];for(i in obj)obj.hasOwnProperty(i)&&parts.push(encodeURIComponent(i)+"="+encodeURIComponent(obj[i]));return parts.join("&")},net.triggerPixel=function(url){var p=new bnt.Promise,image=new Image;return image.onload=function(){return!p.fulfilled&&p.succeed(!0)},image.onerror=function(){return!p.fulfilled&&p.succeed(!1)},image.src=url,p.future},net.cacheBuster=function(url){return url.replace(/(\[timestamp\]|\[CACHEBUSTER\]|\[CACHEBUSTING\]|\%\%RANDOM\%\%|\$\{CACHEBUSTER\})/gi,String(Date.now()))}}(bnt.net||(bnt.net={}))}(bnt=bnt||{}),function(bnt){!function(net){var Monitor=function(){function Monitor(){var _this=this;this.totalbytes=new bnt.ObservableValue(0),this.externalAssetsLoaded=0,this.htmlElementLoaded=function(size){var el=size.currentTarget,elSrc=el.src,size=Object.keys(bnt.LIBRARY).filter(function(assetId){return bnt.LIBRARY[assetId].link.replace(/https|http/,"")==elSrc.replace(/https|http/,"")})[0];size?(size=bnt.LIBRARY[size].size,isNaN(size)||_this.appendLoadedBytes(size)):(bnt.logger.info("RESOURCE NOT IN LIBRARY",elSrc,el),_this.externalAssetsLoaded++)}}return Monitor.prototype.appendLoadedBytes=function(bytes){this.totalbytes.update(this.totalbytes.value+bytes)},Monitor.prototype.monitorHtmlElementLoad=function(htmlElement){htmlElement.addEventListener("load",this.htmlElementLoaded)},Monitor}();net.Monitor=Monitor}(bnt.net||(bnt.net={}))}(bnt=bnt||{}),function(bnt){function resolveImageUrl(imagePath,resolver){return resolver?resolver(imagePath):bnt.getSrc(imagePath)}bnt.getStyleForBackgroundConfig=function(_d,imageUrlResolver){var hasImage=!!_d.canvasBackgroundImage,_c=!!_d.canvasBackgroundColor,isGradient=null===(isGradient=_d.canvasBackgroundColor)||void 0===isGradient?void 0:isGradient.includes("gradient(");if(!_c&&!hasImage)return{background:""};if(hasImage&&!_c){var imageUrl=resolveImageUrl(_d.canvasBackgroundImage,imageUrlResolver),size=null!==(color=_d.canvasBackgroundSize)&&void 0!==color?color:bnt.CanvasBackgroundSize.COVER;return{backgroundColor:"",backgroundImage:"url(".concat(imageUrl,")"),backgroundSize:bnt.getCanvasBackgroundSizeCSS(size),backgroundPosition:"center",backgroundRepeat:"no-repeat"}}if(_c){var color=_d.canvasBackgroundColor;if(isGradient&&hasImage){imageUrl=resolveImageUrl(_d.canvasBackgroundImage,imageUrlResolver),size=null!==(_c=_d.canvasBackgroundSize)&&void 0!==_c?_c:bnt.CanvasBackgroundSize.COVER;return{background:"",backgroundImage:"url(".concat(imageUrl,"), ").concat(color),backgroundSize:"".concat(bnt.getCanvasBackgroundSizeCSS(size),", auto"),backgroundPosition:"center, center",backgroundRepeat:"no-repeat, no-repeat"}}if(isGradient)return{background:"",backgroundImage:color,backgroundSize:"auto",backgroundPosition:"center",backgroundRepeat:"no-repeat"};if(hasImage){imageUrl=resolveImageUrl(_d.canvasBackgroundImage,imageUrlResolver),size=null!==(_d=_d.canvasBackgroundSize)&&void 0!==_d?_d:bnt.CanvasBackgroundSize.COVER;return{backgroundImage:"url(".concat(imageUrl,")"),backgroundColor:color,backgroundSize:bnt.getCanvasBackgroundSizeCSS(size),backgroundPosition:"center",backgroundRepeat:"no-repeat"}}return{backgroundImage:"",backgroundColor:color}}return{}}}(bnt=bnt||{}),function(bnt){!function(mathUtils){function interpolate(previousValue,nextValue,progress,easingFunction){var easedProgress=progress;return previousValue*(1-(easedProgress=(easingFunction=void 0===easingFunction?bnt.EasingFunction.LINEAR:easingFunction)!==bnt.EasingFunction.LINEAR?bnt.easingUtils.applyEasing(progress,easingFunction):easedProgress))+nextValue*easedProgress}mathUtils.clamp=function(min,value,max){return Math.min(Math.max(min,value),max)},mathUtils.getInterpolatedValue=function(previousTime,currentX){if(!previousTime||0===previousTime.length)return 0;if(1===previousTime.length)return previousTime[0][1];var timingFunctionAfter=(previousValue=__spreadArray([],__read(previousTime),!1).sort(function(a,b){return a[0]-b[0]})).filter(function(t){var _b=__read(t,2),t=_b[0];_b[1];return t<=currentX}).at(-1),nextTime=previousValue.find(function(t){var _b=__read(t,2),t=_b[0];_b[1];return currentX<=t});if(!timingFunctionAfter)return nextTime[1];if(!nextTime)return timingFunctionAfter[1];if(timingFunctionAfter[0]===currentX)return timingFunctionAfter[1];var previousTime=(nextValue=__read(timingFunctionAfter,3))[0],previousValue=nextValue[1],timingFunctionAfter=nextValue[2],nextTime=(nextValue=__read(nextTime,2))[0],nextValue=nextValue[1];return previousValue===nextValue?previousValue:interpolate(previousValue,nextValue,(currentX-previousTime)/(nextTime-previousTime),null!=timingFunctionAfter?timingFunctionAfter:bnt.EasingFunction.LINEAR)},mathUtils.interpolate=interpolate}(bnt.mathUtils||(bnt.mathUtils={}))}(bnt=bnt||{}),function(bnt){!function(namingUtils){namingUtils.getCopyName=function(originalName,takenNames){for(var newName,baseName=function(originalName){var lastCopyIndex=originalName.lastIndexOf("_copy_");if(-1!==lastCopyIndex){var suffix=originalName.substring(lastCopyIndex+"_copy_".length);if(!isNaN(Number(suffix)))return originalName.substring(0,lastCopyIndex)}return originalName}(originalName),index=1;takenNames.has(newName=baseName+"_copy_"+index);)index++;return newName}}(bnt.namingUtils||(bnt.namingUtils={}))}(bnt=bnt||{}),function(bnt){!function(objectUtils){objectUtils.mapValues=function(object,mapper){return Object.fromEntries(Object.entries(object).map(function(key){var value=__read(key,2),key=value[0],value=value[1];return[key,mapper(value)]}))},objectUtils.mapArray=function(array,mapItem){return(array||[]).reduce(function(result,item){return __assign(__assign({},result),mapItem(item))},{})},objectUtils.arraysContainSameElements=function(array1,array2){return array1.length===array2.length&&array1.every(function(item){return array2.includes(item)})&&array2.every(function(item){return array1.includes(item)})}}(bnt.objectUtils||(bnt.objectUtils={}))}(bnt=bnt||{}),function(bnt){var _a,ElementDiv;!function(ElementDiv){ElementDiv.MAIN_DIV="mainDiv",ElementDiv.ANIMATION_DIV="animationDiv",ElementDiv.CHILD_DIV="childDiv"}(ElementDiv=ElementDiv||{});var ELEMENT_DIV_SELECTORS_CONFIG=((_a={})[ElementDiv.MAIN_DIV]="",_a[ElementDiv.ANIMATION_DIV]=">.animation",_a[ElementDiv.CHILD_DIV]=">.animation>div",_a),ANIMATION_PROPERTIES_CONFIG={relativeX:{appliedTo:ElementDiv.MAIN_DIV,styleAttribute:"left",styleValueFormatter:function(value){return"".concat(value,"px")},parseFromStyle:function(style){return parseFloat(style.left)}},relativeY:{appliedTo:ElementDiv.MAIN_DIV,styleAttribute:"top",styleValueFormatter:function(value){return"".concat(value,"px")},parseFromStyle:function(style){return parseFloat(style.top)}},width:{appliedTo:ElementDiv.CHILD_DIV,styleAttribute:"width",styleValueFormatter:function(value){return"".concat(value,"px")},parseFromStyle:function(style){return parseFloat(style.width)}},height:{appliedTo:ElementDiv.CHILD_DIV,styleAttribute:"height",styleValueFormatter:function(value){return"".concat(value,"px")},parseFromStyle:function(style){return parseFloat(style.height)}},angle:{appliedTo:ElementDiv.CHILD_DIV,styleAttribute:"transform",styleValueFormatter:function(value){return"rotate(".concat(value,"deg)")},parseFromStyle:function(style){return function(b){if(!b||"none"===b)return 0;var rotateMatch=b.match(/rotate\(([^)]+)\)/);if(rotateMatch){var a=rotateMatch[1];return a.endsWith("deg")?parseFloat(a.slice(0,-3)):a.endsWith("rad")?180*parseFloat(a.slice(0,-3))/Math.PI:parseFloat(a)}a=b.match(/matrix\(([^)]+)\)/);if(a){b=a[1].split(",").map(parseFloat);if(4<=b.length){a=b[0],b=b[1];return 180*Math.atan2(b,a)/Math.PI}}return 0}(style.transform)}},opacity:{appliedTo:ElementDiv.CHILD_DIV,styleAttribute:"opacity",styleValueFormatter:function(value){return"".concat(value)},parseFromStyle:function(parsedOpacity){parsedOpacity=parseFloat(parsedOpacity.opacity);return isNaN(parsedOpacity)?1:parsedOpacity}}};function getSceneClassName(screen,scene){return"".concat(screen.name,"_scene_").concat(scene.id)}function computePropertyChangesForElement(screen,state,scene,elementId,elementAnimation,includeNonAnimatedProperties){void 0===includeNonAnimatedProperties&&(includeNonAnimatedProperties=!1);var initialState=getElementInitialState(elementId,screen,state);if(initialState){var propertyChanges={};return Object.keys(initialState).forEach(function(propertyName){var initialValue=initialState[propertyName],orderedKeyframes=elementAnimation.propertyAnimations[propertyName],startTime=getSceneAnimationStartTime(scene),endTime=getSceneAnimationEndTime(scene);void 0!==initialValue&&(hasAtLeastOneKeyframe(null==orderedKeyframes?void 0:orderedKeyframes.keyframes)?(orderedKeyframes=sortKeyframes(orderedKeyframes.keyframes),propertyChanges[propertyName]=function(initialState,orderedKeyframes){return orderedKeyframes.map(function(kf){var _a;return[kf.time,null!==(_a=kf.value)&&void 0!==_a?_a:initialState,kf.timingFunctionAfter]})}(initialValue,orderedKeyframes)):includeNonAnimatedProperties&&(propertyChanges[propertyName]=[[startTime,initialValue],[endTime,initialValue]]))}),propertyChanges}}function getSceneAnimationStartTime(scene){return scene.scrollDriven&&scene.extendedScroll?-100:0}function getSceneAnimationKeyframeDuration(scene){return scene.scrollDriven?bnt.SCROLL_ANIMATION_KEYFRAME_DURATION:bnt.TIME_ANIMATION_KEYFRAME_DURATION}function getRoundedTimeForScene(keyframeDuration,time){keyframeDuration=getSceneAnimationKeyframeDuration(keyframeDuration);return Math.round(time/keyframeDuration)*keyframeDuration}function getSceneAnimationDuration(scene){return scene.scrollDriven?scene.extendedScroll?300:100:scene.duration}function getSceneAnimationEndTime(scene){return getSceneAnimationStartTime(scene)+getSceneAnimationDuration(scene)}function getCurrentAnimationStateForElement(propertyChanges,currentTime){return bnt.objectUtils.mapValues(propertyChanges,function(changes){return bnt.mathUtils.getInterpolatedValue(changes,currentTime)})}function sortKeyframes(keyframes){return(null!=keyframes?keyframes:[]).sort(function(a,b){return a.time-b.time})}function getElementDivs(elementId){return bnt.objectUtils.mapValues(ELEMENT_DIV_SELECTORS_CONFIG,function(selector){return document.querySelector("#".concat(elementId).concat(selector))})}function pinPropertyOnDiv(div,propertyConfig,value){propertyConfig=ANIMATION_PROPERTIES_CONFIG[propertyConfig];div.style[propertyConfig.styleAttribute]=propertyConfig.styleValueFormatter(value)}function getCSSAnimationDefaultEasing(firstKeyframe){var _a;return firstKeyframe&&void 0===firstKeyframe.value&&null!==(_a=firstKeyframe.timingFunctionAfter)&&void 0!==_a?_a:bnt.EasingFunction.LINEAR}function getPropertyKeyframesName(classNameForElement,property){return"".concat(classNameForElement,"_keyframes_").concat(property)}function createInitialAnimationState(_a,_b){return{relativeX:_a.x,relativeY:_a.y,width:_b.width,height:_b.height,angle:null!==(_a=_b.angle)&&void 0!==_a?_a:0,opacity:null!==(_b=_b.opacity)&&void 0!==_b?_b:1}}function getElementInitialState(element,screen,state){element=screen.getEosByElementId(element);if(element)return createInitialAnimationState(element.getConfig(state),element.element.getConfig(state))}function applyAnimationStateToElement(screen,state,elementId,animationState){var elementDivs=getElementDivs(elementId);screen.getEosByElementId(elementId)&&Object.entries(animationState).forEach(function(propertyConfig){var divForProperty=__read(propertyConfig,2),property=divForProperty[0],value=divForProperty[1],propertyConfig=ANIMATION_PROPERTIES_CONFIG[property],divForProperty=elementDivs[propertyConfig.appliedTo];divForProperty?pinPropertyOnDiv(divForProperty,property,value):console.warn("Warning: Cannot apply property ".concat(property," - DOM element ").concat(propertyConfig.appliedTo," not found for element ").concat(elementId))})}function hasAtLeastOneKeyframe(keyframes){return 0<(keyframes||[]).length}bnt.getSceneClassName=getSceneClassName,bnt.getSceneStyle=function(screen,state,scene){return Object.keys(scene.elementAnimations).map(function(elementId){return function(eosConfig,elementAnimation,scene,elementId){var classNameForElement="".concat(getSceneClassName(eosConfig,scene),"_").concat(elementId),elementConfig=eosConfig.getEosByElementId(elementId);if(!elementConfig)return null;eosConfig=elementConfig.getConfig(elementAnimation),elementConfig=elementConfig.element.getConfig(elementAnimation),elementAnimation=scene.elementAnimations[elementId];return function(scene,classNameForElement,elementId,elementAnimation,eosConfig,elementConfig){var propertiesToAnimate=Object.keys(elementAnimation.propertyAnimations),result=(createInitialAnimationState(eosConfig,elementConfig),[]);return Object.entries(ELEMENT_DIV_SELECTORS_CONFIG).forEach(function(selector){var animationsCSS=__read(selector,2),elementDiv=animationsCSS[0],selector=animationsCSS[1],animationsCSS=propertiesToAnimate.filter(function(property){return ANIMATION_PROPERTIES_CONFIG[property].appliedTo===elementDiv});0<animationsCSS.length&&(animationsCSS=animationsCSS.map(function(property){var firstKeyframe=elementAnimation.propertyAnimations[property].keyframes[0];return"".concat(getPropertyKeyframesName(classNameForElement,property)," ").concat(function(scene,timingFunction){var delay=0<timingFunction.time?"".concat(timingFunction.time,"ms "):"",timingFunction=bnt.easingUtils.formatEasingForCSS(getCSSAnimationDefaultEasing(timingFunction));return"".concat(scene.duration,"ms ").concat(delay).concat(scene.repeatTimes||"infinite"," ").concat(timingFunction," both")}(scene,firstKeyframe))}).join(", "),result.push(""),result.push(".".concat(classNameForElement," #").concat(elementId).concat(selector," {")),result.push("  animation: ".concat(animationsCSS,";")),result.push("}"))}),propertiesToAnimate.forEach(function(property){result.push(""),result.push(function(classNameForElement,duration,property,lastKeyframe){var keyframesRows=[],firstKeyframe=ANIMATION_PROPERTIES_CONFIG[property],attributeName=firstKeyframe.styleAttribute,formatValue=firstKeyframe.styleValueFormatter,firstKeyframe=lastKeyframe.keyframes[0],firstKeyframeTime=firstKeyframe.time,cssAnimationDefaultEasingFunction=getCSSAnimationDefaultEasing(firstKeyframe);keyframesRows.push("@keyframes ".concat(getPropertyKeyframesName(classNameForElement,property)," {")),lastKeyframe.keyframes.forEach(function(keyframe,index){var percentage,formattedEasing,keyframeTimingFunctionCSS;void 0!==keyframe.value&&(percentage=function(time,duration,firstKeyframeTime){return 0!==duration?(time-firstKeyframeTime)/duration*100:0}(keyframe.time,duration,firstKeyframeTime),keyframeTimingFunctionCSS="",(formattedEasing=null!==(formattedEasing=keyframe.timingFunctionAfter)&&void 0!==formattedEasing?formattedEasing:bnt.EasingFunction.LINEAR)!==cssAnimationDefaultEasingFunction&&(formattedEasing=bnt.easingUtils.formatEasingForCSS(formattedEasing),keyframeTimingFunctionCSS="; animation-timing-function: ".concat(formattedEasing)),keyframesRows.push("  ".concat(percentage,"% { ").concat(attributeName,": ").concat(formatValue(keyframe.value)).concat(keyframeTimingFunctionCSS," }")))});lastKeyframe=lastKeyframe.keyframes.at(-1);return keyframesRows.push("  to { ".concat(attributeName,": ").concat(formatValue(lastKeyframe.value)," }")),keyframesRows.push("}"),keyframesRows.join("\n")}(classNameForElement,scene.duration,property,elementAnimation.propertyAnimations[property]))}),result.join("\n")}(scene,classNameForElement,elementId,elementAnimation,eosConfig,elementConfig)}(screen,state,scene,elementId)}).filter(function(style){return null!==style}).join("\n\n")},bnt.pinElementAnimationState=function(elementId){var elementDivs=getElementDivs(elementId);Object.entries(ANIMATION_PROPERTIES_CONFIG).forEach(function(div){var computedStyle=__read(div,2),property=computedStyle[0],propertyConfig=computedStyle[1],div=elementDivs[propertyConfig.appliedTo],computedStyle=window.getComputedStyle(div);pinPropertyOnDiv(div,property,propertyConfig.parseFromStyle(computedStyle))})},bnt.pinElementFinalKeyframeAnimationState=function(screen,state,finalState,elementId,propertyChanges){!(propertyChanges=computePropertyChangesForElement(screen,state,finalState,elementId,propertyChanges))||(finalState=getCurrentAnimationStateForElement(propertyChanges,getSceneAnimationEndTime(finalState)))&&applyAnimationStateToElement(screen,0,elementId,finalState)},bnt.setElementAnimationState=function(screen,state,elementId,propertyChanges,time){applyAnimationStateToElement(screen,0,elementId,getCurrentAnimationStateForElement(propertyChanges,time))},bnt.getAnimatedDivs=function(elementId,animatedProperties){var elementDivs=getElementDivs(elementId),animatedProperties=Object.keys(animatedProperties.propertyAnimations),animatedDivs=[];return animatedProperties.forEach(function(divForProperty){divForProperty=elementDivs[ANIMATION_PROPERTIES_CONFIG[divForProperty].appliedTo];divForProperty&&!animatedDivs.includes(divForProperty)&&animatedDivs.push(divForProperty)}),animatedDivs},bnt.computePropertyChangesForElement=computePropertyChangesForElement,bnt.getSceneAnimationStartTime=getSceneAnimationStartTime,bnt.getSceneAnimationKeyframeDuration=getSceneAnimationKeyframeDuration,bnt.getRoundedTimeForScene=getRoundedTimeForScene,bnt.getSceneAnimationDuration=getSceneAnimationDuration,bnt.getSceneAnimationEndTime=getSceneAnimationEndTime,bnt.getCurrentAnimationStateForElement=getCurrentAnimationStateForElement,bnt.sortKeyframes=sortKeyframes,bnt.applySceneUpdates=function(scene,sceneUpdates){var oldStartTime,oldEndTime,baseSceneProps,updatedScene;return"scrollDriven"in sceneUpdates&&sceneUpdates.scrollDriven!==scene.scrollDriven?(oldStartTime=getSceneAnimationStartTime(scene),oldEndTime=getSceneAnimationEndTime(scene),baseSceneProps=structuredClone({name:scene.name,id:scene.id,elementAnimations:scene.elementAnimations}),updatedScene=sceneUpdates.scrollDriven?bnt.DEFAULT_SCROLL_DRIVEN_SCENE_CONFIG:bnt.DEFAULT_TIME_DRIVEN_SCENE_CONFIG,function(scene,oldStartTime,oldEndTime){var newStartTime=getSceneAnimationStartTime(scene),newEndTime=getSceneAnimationEndTime(scene),timeMapping=[[oldStartTime,newStartTime],[oldEndTime,newEndTime]];Object.values(scene.elementAnimations).forEach(function(elementAnimation){Object.values(elementAnimation.propertyAnimations).forEach(function(propertyAnimation){null!=propertyAnimation&&propertyAnimation.keyframes&&propertyAnimation.keyframes.forEach(function(keyframe){keyframe.time=bnt.mathUtils.getInterpolatedValue(timeMapping,keyframe.time)})})})}(updatedScene=__assign(__assign(__assign({},baseSceneProps),updatedScene),sceneUpdates),oldStartTime,oldEndTime)):updatedScene=__assign(__assign({},structuredClone(scene)),sceneUpdates),function(scene){var animationStartTime=getSceneAnimationStartTime(scene),animationEndTime=getSceneAnimationEndTime(scene);Object.entries(scene.elementAnimations).forEach(function(elementId){var elementAnimation=__read(elementId,2),elementId=elementAnimation[0],elementAnimation=elementAnimation[1],sanitizedPropertyAnimations={};Object.entries(elementAnimation.propertyAnimations).forEach(function(lastBeforeStart){var sanitizedKeyframes=__read(lastBeforeStart,2),property=sanitizedKeyframes[0],lastBeforeStart=sanitizedKeyframes[1].keyframes.map(function(keyframe){return __assign(__assign({},keyframe),{time:getRoundedTimeForScene(scene,keyframe.time)})}),sanitizedKeyframes=lastBeforeStart.filter(function(keyframe){return keyframe.time>=animationStartTime&&keyframe.time<=animationEndTime}).reduce(function(acc,keyframe){return acc[keyframe.time]=keyframe,acc},{});animationStartTime in sanitizedKeyframes||0<(lastBeforeStart=lastBeforeStart.filter(function(keyframe){return keyframe.time<animationStartTime})).length&&(lastBeforeStart=lastBeforeStart.sort(function(a,b){return b.time-a.time})[0],sanitizedKeyframes[animationStartTime]=__assign(__assign({},lastBeforeStart),{time:animationStartTime}));sanitizedKeyframes=Object.values(sanitizedKeyframes).sort(function(a,b){return a.time-b.time}).filter(function(keyframe,index){return 0===index||void 0!==keyframe.value});(sanitizedKeyframes||[]).some(function(keyframe){return void 0!==keyframe.value})&&(sanitizedPropertyAnimations[property]={keyframes:sanitizedKeyframes})}),elementAnimation.propertyAnimations=sanitizedPropertyAnimations,0===Object.keys(sanitizedPropertyAnimations).length&&delete scene.elementAnimations[elementId]})}(updatedScene),updatedScene},bnt.getElementInitialState=getElementInitialState,bnt.reverseScene=function(scene,screen,state){var reversed=structuredClone(scene),startTime=getSceneAnimationStartTime(scene),endTime=getSceneAnimationEndTime(scene);return Object.entries(reversed.elementAnimations).forEach(function(elementId){var elementAnimation=__read(elementId,2),elementId=elementAnimation[0],elementAnimation=elementAnimation[1],initialState=getElementInitialState(elementId,screen,state);Object.entries(elementAnimation.propertyAnimations).forEach(function(property){var propertyAnimation=__read(property,2),property=propertyAnimation[0],propertyAnimation=propertyAnimation[1];if(hasAtLeastOneKeyframe(null==propertyAnimation?void 0:propertyAnimation.keyframes)){var keyframes=propertyAnimation.keyframes;keyframes.sort(function(a,b){return a.time-b.time}),void 0===keyframes[0].value&&initialState&&(keyframes[0].value=initialState[property]);var originalTimingFunctions=keyframes.map(function(kf){return kf.timingFunctionAfter});keyframes.forEach(function(kf){kf.time=startTime+endTime-kf.time}),keyframes.sort(function(a,b){return a.time-b.time});for(var n=keyframes.length,i=0;i<n;i++)keyframes[i].timingFunctionAfter=i<n-1?bnt.easingUtils.reverseEasing(originalTimingFunctions[n-2-i]):void 0}})}),reversed}}(bnt=bnt||{}),function(bnt){!function(scrollUtils){scrollUtils.getScrollPercentage=function(keypointValues,adHeight,adPosition){return keypointValues=[[(keypointValues=[-adHeight,0,keypointValues-adHeight,keypointValues].sort(function(a,b){return a-b}))[0],200],[keypointValues[1],100],[keypointValues[2],0],[keypointValues[3],-100]],bnt.mathUtils.getInterpolatedValue(keypointValues,adPosition)}}(bnt.scrollUtils||(bnt.scrollUtils={}))}(bnt=bnt||{}),"undefined"!=typeof module&&(module.exports=bnt),function(bnt){bnt.ValidationErrors=function(errors){this.errors=errors}}(bnt=bnt||{}),function(bnt){var isMobileView;bnt.initIsMobile=function(api){var promise=new bnt.Promise;return api?api.isMobile().map(function(value){isMobileView=value,promise.succeed(void 0)}):(isMobileView=DeviceContext.isMobile()||DeviceContext.isTablet(),promise.succeed(void 0)),promise.future},bnt.isMobile=function(){return isMobileView}}(bnt=bnt||{}),function(bnt){function updateReference(currentRef,refMap){return currentRef&&refMap.contains(currentRef)?refMap.get(currentRef):null}bnt.cloneContainerContents=function(originalContainer,clonedContainer){var e2e=new bnt.Map(new bnt.ElementHash);originalContainer instanceof bnt.Element&&clonedContainer instanceof bnt.Element&&e2e.put(originalContainer,clonedContainer),originalContainer.forEachEos(function(eos){var clonedEos=eos.clone();e2e.put(eos.element,clonedEos.element),clonedContainer.addElementOnScreenAtEnd(clonedEos)});var fn=function(container){container.forEachEos(function(eos){eos.element instanceof bnt.Group&&fn(eos.element),eos.interactions.forEach(function(int){int.target=updateReference(int.target,e2e)}),eos.element instanceof bnt.Subtitle&&eos.element.getConfigsCopy().mapToArray(function(k){return k}).forEach(function(config){config=eos.element.getConfig(config);config.targetVideo=updateReference(config.targetVideo,e2e)})})};fn(clonedContainer)}}(bnt=bnt||{}),function(bnt){!function(EasingFunction){EasingFunction.LINEAR="linear",EasingFunction.EASE="ease",EasingFunction.EASE_IN="ease-in",EasingFunction.EASE_OUT="ease-out",EasingFunction.EASE_IN_OUT="ease-in-out",EasingFunction.EASE_IN_SINE="ease-in-sine",EasingFunction.EASE_OUT_SINE="ease-out-sine",EasingFunction.EASE_IN_OUT_SINE="ease-in-out-sine",EasingFunction.EASE_IN_QUAD="ease-in-quad",EasingFunction.EASE_OUT_QUAD="ease-out-quad",EasingFunction.EASE_IN_OUT_QUAD="ease-in-out-quad",EasingFunction.EASE_IN_CUBIC="ease-in-cubic",EasingFunction.EASE_OUT_CUBIC="ease-out-cubic",EasingFunction.EASE_IN_OUT_CUBIC="ease-in-out-cubic",EasingFunction.EASE_IN_QUART="ease-in-quart",EasingFunction.EASE_OUT_QUART="ease-out-quart",EasingFunction.EASE_IN_OUT_QUART="ease-in-out-quart",EasingFunction.EASE_IN_QUINT="ease-in-quint",EasingFunction.EASE_OUT_QUINT="ease-out-quint",EasingFunction.EASE_IN_OUT_QUINT="ease-in-out-quint",EasingFunction.EASE_IN_EXPO="ease-in-expo",EasingFunction.EASE_OUT_EXPO="ease-out-expo",EasingFunction.EASE_IN_OUT_EXPO="ease-in-out-expo",EasingFunction.EASE_IN_CIRC="ease-in-circ",EasingFunction.EASE_OUT_CIRC="ease-out-circ",EasingFunction.EASE_IN_OUT_CIRC="ease-in-out-circ",EasingFunction.EASE_IN_BACK="ease-in-back",EasingFunction.EASE_OUT_BACK="ease-out-back",EasingFunction.EASE_IN_OUT_BACK="ease-in-out-back",EasingFunction.EASE_IN_ELASTIC="ease-in-elastic",EasingFunction.EASE_OUT_ELASTIC="ease-out-elastic",EasingFunction.EASE_IN_OUT_ELASTIC="ease-in-out-elastic",EasingFunction.EASE_IN_BOUNCE="ease-in-bounce",EasingFunction.EASE_OUT_BOUNCE="ease-out-bounce",EasingFunction.EASE_IN_OUT_BOUNCE="ease-in-out-bounce"}(bnt.EasingFunction||(bnt.EasingFunction={})),function(EasingFunctionType){EasingFunctionType.CUBIC_BEZIER="cubic-bezier",EasingFunctionType.LINEAR="linear"}(bnt.EasingFunctionType||(bnt.EasingFunctionType={}))}(bnt=bnt||{}),function(bnt){bnt.DEFAULT_TIME_DRIVEN_SCENE_CONFIG={duration:1e3,repeatTimes:1,scrollDriven:!1},bnt.DEFAULT_SCROLL_DRIVEN_SCENE_CONFIG={extendedScroll:!1,scrollDriven:!0},bnt.TIME_ANIMATION_KEYFRAME_DURATION=50,bnt.SCROLL_ANIMATION_KEYFRAME_DURATION=1}(bnt=bnt||{}),function(bnt){var CloseButtonRenderer=function(_super){function CloseButtonRenderer(closeButton){var _this=_super.call(this,closeButton)||this;return _this.closeButton=closeButton,_this}return __extends(CloseButtonRenderer,_super),CloseButtonRenderer.prototype.elementRenderImpl=function(target){return this.closeButtonElement=document.createElement("div"),this.closeButtonElement.innerHTML="X",this.domElementReady.update(void 0),bnt.Promise.fulfilledWith(this.closeButtonElement).future},CloseButtonRenderer.prototype.elementDestroyImpl=function(){return this.closeButtonElement&&this.closeButtonElement.parentNode&&this.closeButtonElement.parentNode.removeChild(this.closeButtonElement),bnt.Promise.fulfilledWith(this.closeButtonElement).future},CloseButtonRenderer.prototype.applyElementConfig=function(config){return this.closeButtonElement&&bnt.style(this.closeButtonElement,{width:bnt.px(config.width),height:bnt.px(config.height)}),bnt.Promise.fulfilledWith(null).future},CloseButtonRenderer.prototype.registerEventListenersImpl=function(){this.registerFor(this.closeButtonElement,"click",this.closeButton.onclick,!0),this.registerFor(this.closeButtonElement,"mouseenter",this.closeButton.onmouseenter),this.registerFor(this.closeButtonElement,"mouseleave",this.closeButton.onmouseleave)},CloseButtonRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.closeButtonElement,"click"),this.unregisterFor(this.closeButtonElement,"mouseenter"),this.unregisterFor(this.closeButtonElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.CloseButton),__metadata("design:paramtypes",[bnt.CloseButton])],CloseButtonRenderer)}(bnt.ElementRenderer);bnt.CloseButtonRenderer=CloseButtonRenderer}(bnt=bnt||{}),function(bnt){var ImageRenderer=function(_super){function ImageRenderer(image){var _this=_super.call(this,image)||this;return _this.image=image,_this}return __extends(ImageRenderer,_super),ImageRenderer.prototype.loadImpl=function(){var config=bnt.get(bnt.State),config=this.image.getConfig(config);return this.imageElement=document.createElement("img"),bnt.get(bnt.net.Monitor).monitorHtmlElementLoad(this.imageElement),this.hoverImageElement=document.createElement("img"),bnt.get(bnt.net.Monitor).monitorHtmlElementLoad(this.hoverImageElement),this.setSrc(config),bnt.setupWebkitResponsiveImageFix(this.imageElement),bnt.setupWebkitResponsiveImageFix(this.hoverImageElement),bnt.Promise.fulfilledWith(null).future},ImageRenderer.prototype.setSrc=function(config){bnt.setSrc(this.imageElement,config.src,config.width),bnt.setSrc(this.hoverImageElement,config.hoverImage,config.width)},ImageRenderer.prototype.show=function(a){var _this=this;this.deactivateHover();a=_super.prototype.show.call(this,a);return a.onComplete.map(function(){_this.lastConfig=_this.element.getConfig(_this.state()),_this.imageElementWithPan&&(_this.imageElementWithPan.registerListeners(),_this.imageElementWithPan.updateConfig(_this.lastConfig)),_this.hoverImageElementWithPan&&(_this.hoverImageElementWithPan.registerListeners(),_this.hoverImageElementWithPan.updateConfig(_this.lastConfig))}),a},ImageRenderer.prototype.hide=function(a){var _this=this,a=_super.prototype.hide.call(this,a);return a.onComplete.map(function(){_this.imageElementWithPan&&_this.imageElementWithPan.unregisterListeners(),_this.hoverImageElementWithPan&&_this.hoverImageElementWithPan.unregisterListeners()}),a},ImageRenderer.prototype.elementRenderImpl=function(target){var _this=this;return this.containerElement=this.htmlElement=document.createElement("div"),this.htmlElement.appendChild(this.imageElement),this.htmlElement.appendChild(this.hoverImageElement),this.domElementReady.update(void 0),this.imageElementWithPan=new bnt.ElementWithPan({container:{element:this.containerElement,width:function(c){return c.width},height:function(c){return c.height}},element:{element:this.imageElement,width:function(c){return c.imageWidth},height:function(c){return c.imageHeight}}}),this.imageElementWithPan.onSizesChange.addObserver(function(sizes){sizes&&_this.imageElement&&(bnt.setSizes(_this.imageElement,bnt.getSizes(sizes.w)),bnt.style(_this.imageElement,{width:"100%",height:"100%",position:"absolute",left:bnt.px(sizes.x),top:bnt.px(sizes.y),userSelect:"none",transform:"translateZ(0)"}))}),this.hoverImageElementWithPan=new bnt.ElementWithPan({container:{element:this.containerElement,width:function(c){return c.width},height:function(c){return c.height}},element:{element:this.hoverImageElement,width:function(c){return c.imageWidth},height:function(c){return c.imageHeight}}}),this.hoverImageElementWithPan.disable(),this.hoverImageElementWithPan.preventAutoEnable(!0),this.hoverImageElementWithPan.onSizesChange.addObserver(function(sizes){sizes&&_this.hoverImageElement&&(bnt.setSizes(_this.hoverImageElement,bnt.getSizes(sizes.w)),bnt.style(_this.hoverImageElement,{width:"100%",height:"100%",position:"absolute",left:bnt.px(sizes.x),top:bnt.px(sizes.y),userSelect:"none",transform:"translateZ(0)"}))}),bnt.Promise.fulfilledWith(this.containerElement).future},ImageRenderer.prototype.elementDestroyImpl=function(){return this.imageElement&&this.imageElement.parentNode&&this.imageElement.parentNode.removeChild(this.imageElement),this.hoverImageElement&&this.hoverImageElement.parentNode&&this.hoverImageElement.parentNode.removeChild(this.hoverImageElement),bnt.Promise.fulfilledWith(this.imageElement).future},ImageRenderer.prototype.applyElementConfig=function(config){return(this.lastConfig=config).visible!=this.element.visible.value&&this.element.visible.update(config.visible),this.setSrc(config),this.configureSizes(config),bnt.Promise.fulfilledWith(null).future},ImageRenderer.prototype.configureSizes=function(config){var width=config.width,height=config.height;this.containerElement&&bnt.style(this.containerElement,{width:bnt.px(width),height:bnt.px(height),transform:"rotate("+config.angle+"deg)",opacity:config.opacity,overflow:"hidden",position:"relative"}),this.imageElementWithPan&&this.imageElementWithPan.updateConfig(config),this.hoverImageElementWithPan&&this.hoverImageElementWithPan.updateConfig(config),this.hoverImageElement&&(this.hoverImageElement.hidden=!0)},ImageRenderer.prototype.registerEventListenersImpl=function(){var _this=this;this.registerFor(this.containerElement,"click",this.image.onclick,!0),this.registerFor(this.containerElement,"mouseenter",this.image.onmouseenter,!1,function(){_this.activateHover(),_this.image.onmouseenter.update(void 0)},!0),this.registerFor(this.containerElement,"mouseleave",this.image.onmouseleave,!1,function(){_this.deactivateHover(),_this.image.onmouseleave.update(void 0)},!0)},ImageRenderer.prototype.deactivateHover=function(){this.hoverImageElement&&this.hoverImageElement.src&&(this.imageElement.hidden=!1,this.hoverImageElement.hidden=!0,this.hoverImageElementWithPan.disable(),this.lastConfig.panActive&&this.imageElementWithPan.enable(),this.hoverImageElementWithPan.forceUpdateLastConfig())},ImageRenderer.prototype.activateHover=function(){this.hoverImageElement&&this.hoverImageElement.src&&(this.imageElement.hidden=!0,this.hoverImageElement.hidden=!1,this.lastConfig.panActive&&this.hoverImageElementWithPan.enable(),this.imageElementWithPan.disable(),this.hoverImageElementWithPan.forceUpdateLastConfig())},ImageRenderer.prototype.unregisterEventListenersImpl=function(){this.unregisterFor(this.containerElement,"click"),this.unregisterFor(this.containerElement,"mouseenter"),this.unregisterFor(this.containerElement,"mouseleave")},__decorate([bnt.RendererOf(bnt.Image),__metadata("design:paramtypes",[bnt.Image])],ImageRenderer)}(bnt.ElementRenderer);bnt.ImageRenderer=ImageRenderer}(bnt=bnt||{}),function(bnt){var ScrollController=function(){function ScrollController(){this.scrollPercentage=new bnt.Observable}return ScrollController.prototype.init=function(api){this.api=api,this.scheduleNextUpdate()},ScrollController.prototype.scheduleNextUpdate=function(){requestAnimationFrame(this.scrollDistanceUpdater.bind(this))},ScrollController.prototype.scrollDistanceUpdater=function(){var adPosition,_this=this;if(this.scrollPercentage.hasObservers(!0))try{this.api?this.api.getSlotBounds().map(function(slotBounds){_this.updateScrollPercentage(slotBounds),_this.scheduleNextUpdate()}):(adPosition=this.getElementScrollPosition(document.body),this.updateScrollPercentage({top:adPosition}),this.scheduleNextUpdate())}catch(error){this.scheduleNextUpdate()}else this.scheduleNextUpdate()},ScrollController.prototype.updateScrollPercentage=function(currentScroll){currentScroll=this.getScrollPercentage(currentScroll);currentScroll!==this.previousScrollPercentage&&(this.scrollPercentage.update(currentScroll),this.previousScrollPercentage=currentScroll)},ScrollController.prototype.getScrollPercentage=function(bounds){var _a,_b,_c,_d,_e;try{var iframeHeight=null!==(_a=window.innerHeight)&&void 0!==_a?_a:0,adHeight=null!==(_b=bounds.height)&&void 0!==_b?_b:iframeHeight,topWindowHeight=null!==(_d=null!==(_c=bounds.viewportHeight)&&void 0!==_c?_c:this.safeReadTopInnerHeight())&&void 0!==_d?_d:iframeHeight,adPosition=null!==(_e=bounds.top)&&void 0!==_e?_e:0;return bnt.scrollUtils.getScrollPercentage(topWindowHeight,adHeight,adPosition)}catch(error){return 100}},ScrollController.prototype.safeReadTopInnerHeight=function(){var _a;try{return null===(_a=window.top)||void 0===_a?void 0:_a.innerHeight}catch(error){return}},ScrollController.prototype.getElementScrollPosition=function(relativePosition,levels){var _b;if(void 0===levels&&(levels=10),!relativePosition||levels<=0)return 0;var topWindow=window.top,parentIFrame=null===(_b=relativePosition.ownerDocument)||void 0===_b?void 0:_b.defaultView,relativePosition=(null===(_b=relativePosition.getBoundingClientRect)||void 0===_b?void 0:_b.call(relativePosition).top)||0;if(topWindow===parentIFrame||!parentIFrame)return relativePosition;parentIFrame=parentIFrame.frameElement;return parentIFrame?relativePosition+this.getElementScrollPosition(parentIFrame,levels-1):relativePosition},__decorate([bnt.Singleton],ScrollController)}();bnt.ScrollController=ScrollController}(bnt=bnt||{}),function(bnt){var Ua=function(){function Ua(){}return Ua.MODEL="model",Ua.NAME="name",Ua.TYPE="type",Ua.VENDOR="vendor",Ua.VERSION="version",Ua.CONSOLE="c",Ua.MOBILE="m",Ua.TABLET="t",Ua.SMARTTV="tv",Ua.WEARABLE="w",Ua.DESKTOP="d",Ua.util={extend:function(regexes,extensions){for(var i in extensions)-1!=="browser device os".indexOf(i)&&extensions[i].length%2==0&&(regexes[i]=extensions[i].concat(regexes[i]));return regexes},has:function(str1,str2){return"string"==typeof str1&&-1!==str2.toLowerCase().indexOf(str1.toLowerCase())},lowerize:function(str){return str.toLowerCase()},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Ua.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[Ua.NAME,Ua.VERSION],[/(opios)[\/\s]+([\w\.]+)/i],[[Ua.NAME,"Opera Mini"],Ua.VERSION],[/\s(opr)\/([\w\.]+)/i],[[Ua.NAME,"Opera"],Ua.VERSION],[/(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],[Ua.NAME,Ua.VERSION],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[Ua.NAME,"IE"],Ua.VERSION],[/(edge)\/((\d+)?[\w\.]+)/i],[Ua.NAME,Ua.VERSION],[/(yabrowser)\/([\w\.]+)/i],[[Ua.NAME,"Yandex"],Ua.VERSION],[/(comodo_dragon)\/([\w\.]+)/i],[[Ua.NAME,/_/g," "],Ua.VERSION],[/(micromessenger)\/([\w\.]+)/i],[[Ua.NAME,"WeChat"],Ua.VERSION],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[Ua.VERSION,[Ua.NAME,"MIUI Browser"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[Ua.NAME,/(.+)/,"$1 WebView"],Ua.VERSION],[/android.+samsungbrowser\/([\w\.]+)/i,/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[Ua.VERSION,[Ua.NAME,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[Ua.NAME,Ua.VERSION],[/(dolfin)\/([\w\.]+)/i],[[Ua.NAME,"Dolphin"],Ua.VERSION],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[Ua.NAME,"Chrome"],Ua.VERSION],[/;fbav\/([\w\.]+);/i],[Ua.VERSION,[Ua.NAME,"Facebook"]],[/fxios\/([\w\.-]+)/i],[Ua.VERSION,[Ua.NAME,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[Ua.VERSION,[Ua.NAME,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[Ua.VERSION,Ua.NAME],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[Ua.NAME,[Ua.VERSION,(Ua.mapper={rgx:function(){for(var result,p,q,match,i=0,j=0,k=0,v=0,matches=void 0,args=arguments;i<args.length&&!matches;){var regex=args[i],props=args[i+1];if(void 0===result)for(p in result={},props)"object"==typeof(q=props[p])?result[q[0]]=void 0:result[q]=void 0;for(j=k=0;j<regex.length&&!matches;)if(matches=regex[j++].exec(bnt.Context.getUA()))for(v=0;v<props.length;v++)match=matches[++k],"object"==typeof(q=props[v])&&0<q.length?2==q.length?"function"==typeof q[1]?result[q[0]]=q[1].call(this,match):result[q[0]]=q[1]:3==q.length?"function"!=typeof q[1]||q[1].exec&&q[1].test?result[q[0]]=match?match.replace(q[1],q[2]):void 0:result[q[0]]=match?q[1].call(this,match,q[2]):void 0:4==q.length&&(result[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):void 0):result[q]=match||void 0;i+=2}return result},str:function(str,map){for(var i in map)if("object"==typeof map[i]&&0<map[i].length){for(var j=0;j<map[i].length;j++)if(Ua.util.has(map[i][j],str))return"?"===i?void 0:i}else if(Ua.util.has(map[i],str))return"?"===i?void 0:i;return str}}).str,(Ua.maps={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:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",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"}}}}).browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[Ua.NAME,Ua.VERSION],[/(navigator|netscape)\/([\w\.-]+)/i],[[Ua.NAME,"Netscape"],Ua.VERSION],[/(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)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[Ua.NAME,Ua.VERSION]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[Ua.MODEL,Ua.VENDOR,[Ua.TYPE,Ua.TABLET]],[/applecoremedia\/[\w\.]+ \((ipad)/],[Ua.MODEL,[Ua.VENDOR,"Apple"],[Ua.TYPE,Ua.TABLET]],[/(apple\s{0,1}tv)/i],[[Ua.MODEL,"Apple TV"],[Ua.VENDOR,"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],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.TABLET]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[Ua.MODEL,[Ua.VENDOR,"Amazon"],[Ua.TYPE,Ua.TABLET]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[Ua.MODEL,Ua.mapper.str,Ua.maps.device.amazon.model],[Ua.VENDOR,"Amazon"],[Ua.TYPE,Ua.MOBILE]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[Ua.MODEL,Ua.VENDOR,[Ua.TYPE,Ua.MOBILE]],[/\((ip[honed|\s\w*]+);/i],[Ua.MODEL,[Ua.VENDOR,"Apple"],[Ua.TYPE,Ua.MOBILE]],[/(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],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.MOBILE]],[/\(bb10;\s(\w+)/i],[Ua.MODEL,[Ua.VENDOR,"BlackBerry"],[Ua.TYPE,Ua.MOBILE]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[Ua.MODEL,[Ua.VENDOR,"Asus"],[Ua.TYPE,Ua.TABLET]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[Ua.VENDOR,"Sony"],[Ua.MODEL,"Xperia Tablet"],[Ua.TYPE,Ua.TABLET]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[Ua.VENDOR,"Sony"],[Ua.MODEL,"Xperia Phone"],[Ua.TYPE,Ua.MOBILE]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.CONSOLE]],[/android.+;\s(shield)\sbuild/i],[Ua.MODEL,[Ua.VENDOR,"Nvidia"],[Ua.TYPE,Ua.CONSOLE]],[/(playstation\s[3portablevi]+)/i],[Ua.MODEL,[Ua.VENDOR,"Sony"],[Ua.TYPE,Ua.CONSOLE]],[/(sprint\s(\w+))/i],[[Ua.VENDOR,Ua.mapper.str,Ua.maps.device.sprint.vendor],[Ua.MODEL,Ua.mapper.str,Ua.maps.device.sprint.model],[Ua.TYPE,Ua.MOBILE]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.TABLET]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[Ua.VENDOR,[Ua.MODEL,/_/g," "],[Ua.TYPE,Ua.MOBILE]],[/(nexus\s9)/i],[Ua.MODEL,[Ua.VENDOR,"HTC"],[Ua.TYPE,Ua.TABLET]],[/(nexus\s6p)/i],[Ua.MODEL,[Ua.VENDOR,"Huawei"],[Ua.TYPE,Ua.MOBILE]],[/(microsoft);\s(lumia[\s\w]+)/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.MOBILE]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[Ua.MODEL,[Ua.VENDOR,"Microsoft"],[Ua.TYPE,Ua.CONSOLE]],[/(kin\.[onetw]{3})/i],[[Ua.MODEL,/\./g," "],[Ua.VENDOR,"Microsoft"],[Ua.TYPE,Ua.MOBILE]],[/\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],[Ua.MODEL,[Ua.VENDOR,"Motorola"],[Ua.TYPE,Ua.MOBILE]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[Ua.MODEL,[Ua.VENDOR,"Motorola"],[Ua.TYPE,Ua.TABLET]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[Ua.VENDOR,Ua.util.trim],[Ua.MODEL,Ua.util.trim],[Ua.TYPE,Ua.SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[Ua.MODEL,/^/,"SmartTV"],[Ua.VENDOR,"Samsung"],[Ua.TYPE,Ua.SMARTTV]],[/\(dtv[\);].+(aquos)/i],[Ua.MODEL,[Ua.VENDOR,"Sharp"],[Ua.TYPE,Ua.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],[[Ua.VENDOR,"Samsung"],Ua.MODEL,[Ua.TYPE,Ua.TABLET]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[Ua.VENDOR,"Samsung"],Ua.MODEL,[Ua.TYPE,Ua.MOBILE]],[/smart-tv.+(samsung)/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.SMARTTV]],[/sie-(\w+)*/i],[Ua.MODEL,[Ua.VENDOR,"Siemens"],[Ua.TYPE,Ua.MOBILE]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[Ua.VENDOR,"Nokia"],Ua.MODEL,[Ua.TYPE,Ua.MOBILE]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[Ua.MODEL,[Ua.VENDOR,"Acer"],[Ua.TYPE,Ua.TABLET]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[Ua.VENDOR,"LG"],Ua.MODEL,[Ua.TYPE,Ua.TABLET]],[/(lg) netcast\.tv/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.SMARTTV]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[Ua.MODEL,[Ua.VENDOR,"LG"],[Ua.TYPE,Ua.MOBILE]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[Ua.MODEL,[Ua.VENDOR,"Lenovo"],[Ua.TYPE,Ua.TABLET]],[/linux;.+((jolla));/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.MOBILE]],[/((pebble))app\/[\d\.]+\s/i],[Ua.VENDOR,Ua.MODEL,[Ua.TYPE,Ua.WEARABLE]],[/android.+;\s(glass)\s\d/i],[Ua.MODEL,[Ua.VENDOR,"Google"],[Ua.TYPE,Ua.WEARABLE]],[/android.+;\s(pixel c)\s/i],[Ua.MODEL,[Ua.VENDOR,"Google"],[Ua.TYPE,Ua.TABLET]],[/android.+;\s(pixel xl|pixel)\s/i],[Ua.MODEL,[Ua.VENDOR,"Google"],[Ua.TYPE,Ua.MOBILE]],[/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],[[Ua.MODEL,/_/g," "],[Ua.VENDOR,"Xiaomi"],[Ua.TYPE,Ua.MOBILE]],[/android.+a000(1)\s+build/i],[Ua.MODEL,[Ua.VENDOR,"OnePlus"],[Ua.TYPE,Ua.MOBILE]],[/\s(tablet)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[Ua.TYPE,Ua.util.lowerize],Ua.VENDOR,Ua.MODEL]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[Ua.NAME,Ua.VERSION],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[Ua.NAME,[Ua.VERSION,Ua.mapper.str,Ua.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[Ua.NAME,"Windows"],[Ua.VERSION,Ua.mapper.str,Ua.maps.os.windows.version]],[/\((bb)(10);/i],[[Ua.NAME,"BlackBerry"],Ua.VERSION],[/(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],[Ua.NAME,Ua.VERSION],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[Ua.NAME,"Symbian"],Ua.VERSION],[/\((series40);/i],[Ua.NAME],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[Ua.NAME,"Firefox OS"],Ua.VERSION],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[Ua.NAME,Ua.VERSION],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[Ua.NAME,"Chromium OS"],Ua.VERSION],[/(sunos)\s?([\w\.]+\d)*/i],[[Ua.NAME,"Solaris"],Ua.VERSION],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[Ua.NAME,Ua.VERSION],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[Ua.NAME,"iOS"],[Ua.VERSION,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[Ua.NAME,"Mac OS"],[Ua.VERSION,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\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],[Ua.NAME,Ua.VERSION]]},Ua}();bnt.Ua=Ua}(bnt=bnt||{}),function(bnt){var UABrowser=function(){function UABrowser(browser){this.name=browser.name||"",this.version=browser.version||"",this.major="string"==typeof this.version?this.version.split(".")[0]:""}return UABrowser.prototype.toString=function(){return[this.name,this.version].join("|").toLowerCase()},UABrowser}();bnt.UABrowser=UABrowser;var UAOs=function(){function UAOs(vsplited){this.name=vsplited.name||"",this.version=vsplited.version||"";vsplited=this.version.split(".");this.vmajor=vsplited[0]||"0",this.vminor=vsplited[1]||"0",this.vpatch=vsplited[2]||"0"}return UAOs.prototype.toString=function(){return[this.name,this.version].join("|").toLowerCase()},UAOs}();bnt.UAOs=UAOs;var UADevice=function(){function UADevice(device){this.model=device.model||"",this.type=device.type||(UADevice.typeRegExp.test(Context.getOS().name)?bnt.Ua.DESKTOP:""),this.vendor=device.vendor||""}return UADevice.prototype.toString=function(){return[this.model,this.type,this.vendor].join("|").toLowerCase()},UADevice.typeRegExp=/^windows|mac\s+os|linux|bsd|dragonfly|chromium\s+os|haiku|ubuntu|slackware|gentoo|solaris|debian|fedora|arch|beos|mint|gnu|os\/2$/i,UADevice}();bnt.UADevice=UADevice;var browser="undefined"!=typeof window,Context=function(){function Context(){}return Context.isDesktop=function(){return!Context.isMobile()&&!Context.isTablet()},Context.isIpad=function(){return"iPad"===Context.getDevice().model||/iPad/i.test(Context.getUA())},Context.isTablet=function(){return"tablet"===Context.getDevice().type||Context.isIpad()||Context.isAndroid()&&!/(m|M)obile/.test(Context.getUA())},Context.isMobile=function(){return"mobile"===Context.getDevice().type||Context.isIos()&&!Context.isIpad()||Context.isAndroid()&&/(m|M)obile/.test(Context.getUA())},Context.isChromeIos=function(){return/CriOS/i.test(Context.getUA())},Context.isFacebookWebview=function(){return"Facebook"===Context.getBrowser().name||/FBAN|FBIOS|FBAV|FBBV|FBDV|FBMD|FBSN|FBSV|FBSS|FBCR|FBID|FBLC|FBOP/i.test(Context.getUA())},Context.isAndroidNative=function(){return"Android Browser"===Context.getBrowser().name},Context.isAndroid=function(){return"Android"===Context.getOS().name||/Android/i.test(Context.getUA())},Context.isIos=function(){return"iOS"===Context.getOS().name||Context.isIpad()||Context.isIphone()},Context.isIphone=function(){return"iPhone"===Context.getDevice().model||/iPhone/i.test(Context.getUA())},Context.isAndroidMobile=function(){return Context.isAndroid()&&Context.isMobile()},Context.isOldIE=function(maxVersion){return void 0===maxVersion&&(maxVersion=9),Context.isIE()&&!!Context.getBrowser().major&&parseInt(Context.getBrowser().major,10)<=maxVersion},Context.isIE=function(){return"IE"===Context.getBrowser().name||/MSIE|Trident/.test(Context.getUA())},Context.isChrome=function(){return"Chrome"===Context.getBrowser().name||!!window.chrome},Context.isFirefox=function(){return"Firefox"===Context.getBrowser().name||/Firefox/i.test(Context.getUA())},Context.isAmpObserveIntersection=function(){return!(!window.context||!window.context.observeIntersection)},Context.getIEVersion=function(){return Context.isIE()&&Context.getBrowser().major?parseInt(Context.getBrowser().major,10):null},Context.getAndroidVersion=function(){return Context.isAndroid()?parseFloat(Context.getOS().vmajor+Context.getOS().vminor+"."+Context.getOS().vpatch):null},Context.getIosVersion=function(){return Context.isIos()?parseFloat(Context.getOS().vmajor+Context.getOS().vminor+"."+Context.getOS().vpatch):null},Context.isUIWebview=function(){return(Context.isIphone()||Context.isIpad())&&!/Safari/i.test(Context.getUA())&&!window.navigator.standalone},Context.isIos10Safari=function(){return 100<=Context.getIosVersion()&&!Context.isUIWebview()&&!Context.isChromeIos()},Context.videoSupport=function(context){return!!context.createElement("video").canPlayType},Context.getLanguage=function(){return window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage||"en"},Context.getUA=function(){return window.parent.navigator.userAgent},Context.getDevice=function(){return this.device||(this.device=new UADevice(bnt.Ua.mapper.rgx.apply(this,bnt.Ua.regexes.device))),this.device},Context.getOS=function(){return this.os||(this.os=new UAOs(bnt.Ua.mapper.rgx.apply(this,bnt.Ua.regexes.os))),this.os},Context.getBrowser=function(){return this.browser||(this.browser=new UABrowser(bnt.Ua.mapper.rgx.apply(this,bnt.Ua.regexes.browser))),this.browser},Context.userAgent=(browser&&window.parent).userAgent,Context}();bnt.Context=Context}(bnt=bnt||{}),function(bnt){var browser="undefined"!=typeof window,gv=browser&&window.parent.gv||"",creativeId=function(){return browser&&(window.parent.creativeId||window.cid)||""},adaptor=browser&&window.parent.adaptor||"",sessionId=function(length){for(var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",str="",i=0;i<length;i++)str+=chars.charAt(Math.floor(Math.random()*chars.length));return str}(10),epoch=Date.now(),SUMOLOGIC_ENDPOINT="https://l.teads.tv/studio/frontend";bnt.sumo=function(message_with_meta,level){void 0===level&&(level="info"),message_with_meta=Object.assign({ci:creativeId(),a:adaptor,t:Date.now()-epoch,d:bnt.Context.getDevice().type,o:bnt.Context.getOS().name,ov:bnt.Context.getOS().version,b:bnt.Context.getBrowser().name,bv:bnt.Context.getBrowser().version,vs:bnt.AdController.instance&&bnt.AdController.instance.videoSlot&&bnt.AdController.instance.videoSlot.tagName,gv:gv},message_with_meta),function(message){bnt.logger.debug("# sumo",message);try{Object.assign(new Image,{src:"".concat(SUMOLOGIC_ENDPOINT,"?").concat(encodeURIComponent(message))})}catch(e){}}(function(message){var timestamp=message.timestamp,sessionId=message.sessionId,level=message.level,message=message.message;return"[".concat(timestamp,"][").concat(sessionId,"][").concat(level,"] ").concat(message)}({timestamp:Date.now(),sessionId:sessionId,level:level,message:JSON.stringify(message_with_meta)}))}}(bnt=bnt||{}),function(bnt){var _a;bnt.EASING_FUNCTIONS_CONFIG=((_a={})[bnt.EasingFunction.LINEAR]={type:bnt.EasingFunctionType.CUBIC_BEZIER,cssAlias:"linear",x1:0,y1:0,x2:1,y2:1},_a[bnt.EasingFunction.EASE]={type:bnt.EasingFunctionType.CUBIC_BEZIER,cssAlias:"ease",x1:.25,y1:.1,x2:.25,y2:1},_a[bnt.EasingFunction.EASE_IN]={type:bnt.EasingFunctionType.CUBIC_BEZIER,cssAlias:"ease-in",x1:.42,y1:0,x2:1,y2:1},_a[bnt.EasingFunction.EASE_OUT]={type:bnt.EasingFunctionType.CUBIC_BEZIER,cssAlias:"ease-out",x1:0,y1:0,x2:.58,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT]={type:bnt.EasingFunctionType.CUBIC_BEZIER,cssAlias:"ease-in-out",x1:.42,y1:0,x2:.58,y2:1},_a[bnt.EasingFunction.EASE_IN_SINE]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.12,y1:0,x2:.39,y2:0},_a[bnt.EasingFunction.EASE_OUT_SINE]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.61,y1:1,x2:.88,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_SINE]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.37,y1:0,x2:.63,y2:1},_a[bnt.EasingFunction.EASE_IN_QUAD]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.11,y1:0,x2:.5,y2:0},_a[bnt.EasingFunction.EASE_OUT_QUAD]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.5,y1:1,x2:.89,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_QUAD]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.45,y1:0,x2:.55,y2:1},_a[bnt.EasingFunction.EASE_IN_CUBIC]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.32,y1:0,x2:.67,y2:0},_a[bnt.EasingFunction.EASE_OUT_CUBIC]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.33,y1:1,x2:.68,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_CUBIC]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.65,y1:0,x2:.35,y2:1},_a[bnt.EasingFunction.EASE_IN_QUART]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.5,y1:0,x2:.75,y2:0},_a[bnt.EasingFunction.EASE_OUT_QUART]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.25,y1:1,x2:.5,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_QUART]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.76,y1:0,x2:.24,y2:1},_a[bnt.EasingFunction.EASE_IN_QUINT]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.64,y1:0,x2:.78,y2:0},_a[bnt.EasingFunction.EASE_OUT_QUINT]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.22,y1:1,x2:.36,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_QUINT]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.83,y1:0,x2:.17,y2:1},_a[bnt.EasingFunction.EASE_IN_EXPO]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.7,y1:0,x2:.84,y2:0},_a[bnt.EasingFunction.EASE_OUT_EXPO]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.16,y1:1,x2:.3,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_EXPO]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.87,y1:0,x2:.13,y2:1},_a[bnt.EasingFunction.EASE_IN_CIRC]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.55,y1:0,x2:1,y2:.45},_a[bnt.EasingFunction.EASE_OUT_CIRC]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:0,y1:.55,x2:.45,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_CIRC]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.85,y1:0,x2:.15,y2:1},_a[bnt.EasingFunction.EASE_IN_BACK]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.36,y1:0,x2:.66,y2:-.56},_a[bnt.EasingFunction.EASE_OUT_BACK]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.34,y1:1.56,x2:.64,y2:1},_a[bnt.EasingFunction.EASE_IN_OUT_BACK]={type:bnt.EasingFunctionType.CUBIC_BEZIER,x1:.68,y1:-.6,x2:.32,y2:1.6},_a[bnt.EasingFunction.EASE_IN_ELASTIC]={type:bnt.EasingFunctionType.LINEAR,steps:[{time:0,output:0},{time:.04,output:4e-4},{time:.08,output:.0016},{time:.14,output:.0017},{time:.18,output:-4e-4},{time:.26,output:-.0058},{time:.28,output:-.0055},{time:.4,output:.0156},{time:.42,output:.0164},{time:.56,output:-.0463},{time:.58,output:-.044},{time:.72,output:.1312},{time:.86,output:-.3706},{time:1,output:1}]},_a[bnt.EasingFunction.EASE_OUT_ELASTIC]={type:bnt.EasingFunctionType.LINEAR,steps:[{time:0,output:0},{time:.16,output:1.3227},{time:.28,output:.8688},{time:.44,output:1.0463},{time:.59,output:.9836},{time:.73,output:1.0058},{time:.88,output:.998},{time:1,output:1}]},_a[bnt.EasingFunction.EASE_IN_OUT_ELASTIC]={type:bnt.EasingFunctionType.LINEAR,steps:[{time:0,output:0},{time:.04,output:8e-4},{time:.08,output:.001},{time:.18,output:-.0052},{time:.2,output:-.0039},{time:.28,output:.0235},{time:.3,output:.0239},{time:.38,output:-.0927},{time:.4,output:-.1175},{time:.6,output:1.1175},{time:.62,output:1.0927},{time:.7,output:.9761},{time:.72,output:.9765},{time:.8,output:1.0039},{time:.82,output:1.0052},{time:.9,output:.9997},{time:.92,output:.999},{time:1,output:1}]},_a[bnt.EasingFunction.EASE_IN_BOUNCE]={type:bnt.EasingFunctionType.LINEAR,steps:[{time:0,output:0},{time:.04,output:.0154},{time:.08,output:.0066},{time:.18,output:.0625},{time:.26,output:.0163},{time:.46,output:.2498},{time:.64,output:.0199},{time:.76,output:.5644},{time:.88,output:.8911},{time:1,output:1}]},_a[bnt.EasingFunction.EASE_OUT_BOUNCE]={type:bnt.EasingFunctionType.LINEAR,steps:[{time:0,output:0},{time:.12,output:.1089},{time:.24,output:.4356},{time:.36,output:.9801},{time:.54,output:.7502},{time:.74,output:.9837},{time:.82,output:.9375},{time:.92,output:.9934},{time:.96,output:.9846},{time:1,output:1}]},_a[bnt.EasingFunction.EASE_IN_OUT_BOUNCE]={type:bnt.EasingFunctionType.LINEAR,steps:[{time:0,output:0},{time:.02,output:.0077},{time:.04,output:.0033},{time:.1,output:.03},{time:.14,output:.0098},{time:.22,output:.1242},{time:.32,output:.01},{time:.42,output:.4032},{time:.5,output:.5},{time:.58,output:.5968},{time:.68,output:.9901},{time:.78,output:.8758},{time:.86,output:.9902},{time:.9,output:.97},{time:.96,output:.9967},{time:.98,output:.9923},{time:1,output:1}]},_a)}(bnt=bnt||{}),function(bnt){!function(_b){var _a;function formatEasingConfigForCSS(easingFunctionConfig){return easingFunctionConfig?easingFunctionConfig.cssAlias||(0,EASING_FUNCTION_TYPES_CONFIG[easingFunctionConfig.type].format)(easingFunctionConfig):"linear"}function applyEasingConfig(progress,easingFunctionConfig){return easingFunctionConfig?(0,EASING_FUNCTION_TYPES_CONFIG[easingFunctionConfig.type].apply)(progress,easingFunctionConfig):progress}_b.formatEasingForCSS=function(easingFunction){return formatEasingConfigForCSS(bnt.EASING_FUNCTIONS_CONFIG[easingFunction])},_b.applyEasing=function(progress,easingFunction){return applyEasingConfig(progress,bnt.EASING_FUNCTIONS_CONFIG[easingFunction])},_b.formatEasingConfigForCSS=formatEasingConfigForCSS,_b.applyEasingConfig=applyEasingConfig;var REVERSE_EASING_MAP=((_a={})[bnt.EasingFunction.LINEAR]=bnt.EasingFunction.LINEAR,_a[bnt.EasingFunction.EASE]=bnt.EasingFunction.EASE,_a[bnt.EasingFunction.EASE_IN]=bnt.EasingFunction.EASE_OUT,_a[bnt.EasingFunction.EASE_OUT]=bnt.EasingFunction.EASE_IN,_a[bnt.EasingFunction.EASE_IN_OUT]=bnt.EasingFunction.EASE_IN_OUT,_a[bnt.EasingFunction.EASE_IN_SINE]=bnt.EasingFunction.EASE_OUT_SINE,_a[bnt.EasingFunction.EASE_OUT_SINE]=bnt.EasingFunction.EASE_IN_SINE,_a[bnt.EasingFunction.EASE_IN_OUT_SINE]=bnt.EasingFunction.EASE_IN_OUT_SINE,_a[bnt.EasingFunction.EASE_IN_QUAD]=bnt.EasingFunction.EASE_OUT_QUAD,_a[bnt.EasingFunction.EASE_OUT_QUAD]=bnt.EasingFunction.EASE_IN_QUAD,_a[bnt.EasingFunction.EASE_IN_OUT_QUAD]=bnt.EasingFunction.EASE_IN_OUT_QUAD,_a[bnt.EasingFunction.EASE_IN_CUBIC]=bnt.EasingFunction.EASE_OUT_CUBIC,_a[bnt.EasingFunction.EASE_OUT_CUBIC]=bnt.EasingFunction.EASE_IN_CUBIC,_a[bnt.EasingFunction.EASE_IN_OUT_CUBIC]=bnt.EasingFunction.EASE_IN_OUT_CUBIC,_a[bnt.EasingFunction.EASE_IN_QUART]=bnt.EasingFunction.EASE_OUT_QUART,_a[bnt.EasingFunction.EASE_OUT_QUART]=bnt.EasingFunction.EASE_IN_QUART,_a[bnt.EasingFunction.EASE_IN_OUT_QUART]=bnt.EasingFunction.EASE_IN_OUT_QUART,_a[bnt.EasingFunction.EASE_IN_QUINT]=bnt.EasingFunction.EASE_OUT_QUINT,_a[bnt.EasingFunction.EASE_OUT_QUINT]=bnt.EasingFunction.EASE_IN_QUINT,_a[bnt.EasingFunction.EASE_IN_OUT_QUINT]=bnt.EasingFunction.EASE_IN_OUT_QUINT,_a[bnt.EasingFunction.EASE_IN_EXPO]=bnt.EasingFunction.EASE_OUT_EXPO,_a[bnt.EasingFunction.EASE_OUT_EXPO]=bnt.EasingFunction.EASE_IN_EXPO,_a[bnt.EasingFunction.EASE_IN_OUT_EXPO]=bnt.EasingFunction.EASE_IN_OUT_EXPO,_a[bnt.EasingFunction.EASE_IN_CIRC]=bnt.EasingFunction.EASE_OUT_CIRC,_a[bnt.EasingFunction.EASE_OUT_CIRC]=bnt.EasingFunction.EASE_IN_CIRC,_a[bnt.EasingFunction.EASE_IN_OUT_CIRC]=bnt.EasingFunction.EASE_IN_OUT_CIRC,_a[bnt.EasingFunction.EASE_IN_BACK]=bnt.EasingFunction.EASE_OUT_BACK,_a[bnt.EasingFunction.EASE_OUT_BACK]=bnt.EasingFunction.EASE_IN_BACK,_a[bnt.EasingFunction.EASE_IN_OUT_BACK]=bnt.EasingFunction.EASE_IN_OUT_BACK,_a[bnt.EasingFunction.EASE_IN_ELASTIC]=bnt.EasingFunction.EASE_OUT_ELASTIC,_a[bnt.EasingFunction.EASE_OUT_ELASTIC]=bnt.EasingFunction.EASE_IN_ELASTIC,_a[bnt.EasingFunction.EASE_IN_OUT_ELASTIC]=bnt.EasingFunction.EASE_IN_OUT_ELASTIC,_a[bnt.EasingFunction.EASE_IN_BOUNCE]=bnt.EasingFunction.EASE_OUT_BOUNCE,_a[bnt.EasingFunction.EASE_OUT_BOUNCE]=bnt.EasingFunction.EASE_IN_BOUNCE,_a[bnt.EasingFunction.EASE_IN_OUT_BOUNCE]=bnt.EasingFunction.EASE_IN_OUT_BOUNCE,_a);_b.reverseEasing=function(easing){if(void 0!==easing)return REVERSE_EASING_MAP[easing]};var EASING_FUNCTION_TYPES_CONFIG=((_b={})[bnt.EasingFunctionType.CUBIC_BEZIER]={format:function(easingFunctionConfig){return"cubic-bezier(".concat(easingFunctionConfig.x1,", ").concat(easingFunctionConfig.y1,", ").concat(easingFunctionConfig.x2,", ").concat(easingFunctionConfig.y2,")")},apply:function(progress,easingFunctionConfig){return function(x,x1,y1,x2,y2){if(x<=0)return 0;if(1<=x)return 1;if(x1===y1&&x2===y2)return x;for(var t=x,i=0;i<8;i++){var diff=function(t,bx,x2){var cx=3*bx,bx=3*(x2-bx)-cx;return(((1-cx-bx)*t+bx)*t+cx)*t}(t,x1,x2)-x;if(Math.abs(diff)<1e-7)break;var derivative=function(t,bx,x2){var cx=3*bx,bx=3*(x2-bx)-cx;return 3*(1-cx-bx)*t*t+2*bx*t+cx}(t,x1,x2);if(Math.abs(derivative)<1e-7)break;t-=diff/derivative,t=Math.max(0,Math.min(1,t))}return function(t,by,y2){var cy=3*by,by=3*(y2-by)-cy;return(((1-cy-by)*t+by)*t+cy)*t}(t,y1,y2)}(progress,easingFunctionConfig.x1,easingFunctionConfig.y1,easingFunctionConfig.x2,easingFunctionConfig.y2)}},_b[bnt.EasingFunctionType.LINEAR]={format:function(formattedSteps){if(0===formattedSteps.steps.length)return"linear";formattedSteps=formattedSteps.steps.map(function(step){var timePercent=(100*step.time).toString();return"".concat(step.output," ").concat(timePercent,"%")});return"linear(".concat(formattedSteps.join(", "),")")},apply:function(progress,timelinePoints){timelinePoints=timelinePoints.steps.map(function(step){return[step.time,step.output]});return bnt.mathUtils.getInterpolatedValue(timelinePoints,progress)}},_b)}(bnt.easingUtils||(bnt.easingUtils={}))}(bnt=bnt||{}),function(bnt){function getJustifyContent(textVerticalAlign){switch(textVerticalAlign){case bnt.TextVerticalAlign.CENTER:return"center";case bnt.TextVerticalAlign.BOTTOM:return"flex-end";default:return"flex-start"}}function computeFontStyle(config){var lineHeightStyle=void 0===config.lineHeight?"":"/".concat(config.lineHeight,"px");return"".concat(config.fontStyle," ").concat(config.fontWeight," ").concat(config.fontSize,"px").concat(lineHeightStyle," ").concat(config.fontFamily)}function getTextStyle(verticalAlign){return verticalAlign===bnt.TextVerticalAlign.TOP?{}:{display:"flex",flexDirection:"column",justifyContent:getJustifyContent(verticalAlign)}}function computeTextShadow(config){return config.textShadow?"".concat(config.textShadow.x,"px ").concat(config.textShadow.y,"px ").concat(config.textShadow.blur,"px ").concat(config.textShadow.color):void 0}function computeTextOutline(config){return config.textOutline?"".concat(config.textOutline.size,"px ").concat(config.textOutline.color):void 0}bnt.getJustifyContent=getJustifyContent,bnt.computeFontStyle=computeFontStyle,bnt.getTextStyle=getTextStyle,bnt.computeTextShadow=computeTextShadow,bnt.computeTextOutline=computeTextOutline,bnt.computeTextElementStyle=function(config){return __assign({color:config.color,background:config.textBackgroundColor,font:computeFontStyle(config),textAlign:config.textAlign,letterSpacing:bnt.px(config.letterSpacing),textTransform:config.textTransform,textDecoration:config.textDecoration,textShadow:computeTextShadow(config),webkitTextStroke:computeTextOutline(config),paintOrder:config.textOutline?"stroke fill":void 0,webkitTapHighlightColor:"rgba(0, 0, 0, 0)"},getTextStyle(config.textVerticalAlign))}}(bnt=bnt||{});