var kpfLayerCounter=0;var eventOverallDuration=0;var KPFPlaybackController=Class.create({initialize:function(b,a){this.domNode=a;this.kpfEvent=null},destroy:function(){this.removeEvent();this.domNode=null},removeEvent:function(){if(this.kpfEvent){this.kpfEvent.destroy();delete this.kpfEvent;this.kpfEvent=null;while(this.domNode.childNodes.length>0){this.domNode.removeChild(this.domNode.childNodes[0])}}},renderEvent:function(a){this.removeEvent();this.kpfEvent=a;this.kpfEvent.renderEvent(this.domNode)},renderEffects:function(){var a=this.kpfEvent.renderEffects(this.kpfEvent.event.effects);return a},animateEffects:function(a){this.kpfEvent.animateEffects(a)},eventOverallEndTime:function(){return this.kpfEvent.eventOverallEndTime}});var KPFEvent=Class.create({initialize:function(a){this.slideId=a.slideId;this.slideIndex=a.slideIndex;this.sceneIndex=a.sceneIndex;this.animationSupported=a.animationSupported;this.event=a.event;this.baseLayer={};this.effects=[];this.cssRenderer={};this.glRenderer={};this.canvasIdFromObjectIdLookup={};this.eventOverallEndTime=0;this.overallEndTimeInternal()},destroy:function(){this.baseLayer.destroy();this.cssRenderer.destroy();for(var a=0,b=this.effects.length;a0){for(var b=0,e=c.animations.length;b0){for(var a=0,d=c.layers.length;ad[l].beginTime+d[l].duration){d[l].duration=m.beginTime+m.duration}for(var e=0,c=m.effects.length;e0){setTimeout(this.handleEffectDidComplete.bind(this,c),(c.beginTime+c.duration)*1000)}},animateEffectWillBegin:function(e){var d=e.canvasId;var b=e.effect;var c=this.glRenderer[d];c.draw(b);if(!c.animationStarted){c.animate();c.animationStarted=true}var a=document.getElementById(e.nodeToSwapId);if(!a){return}setTimeout(this.handleAnimateEffectDidBegin.bind(this,a),0)},handleAnimateEffectDidBegin:function(a){a.style.opacity=0},handleEffectDidComplete:function(c){var e=this.renderEffects(c.effects);for(var b=0,d=e.length;bthis.eventOverallEndTime){this.eventOverallEndTime=b}for(var a=0,d=c.effects.length;a-1){this.isEmphasisBuild=true}if(b.movie){this.movie=b.movie}this.effects=[];this.addSubEffect(b.effects,a)},destroy:function(){for(var a=0,b=this.effects.length;a=0){this.insertAfterTextureId=d[b-1].textureId}}}},observeEvents:function(a){var b=this.videoElement;Event.stopObserving(b,"canplay");Event.stopObserving(b,"ended");Event.observe(b,"canplay",this.handleMovieDidStart.bind(this,a));Event.observe(b,"ended",this.handleMovieDidEnd.bind(this,a))},setLoop:function(a){this.videoElement.loop=a},setVolume:function(a){this.videoElement.volume=a},removeControls:function(){if(this.videoElement.hasAttribute("controls")){this.videoElement.removeAttribute("controls")}},handleMovieDidStart:function(a){this.videoElement.style.visibility="visible";if(a){setTimeout(this.hideMoviePoster.bind(this,a),120)}},handleMovieDidEnd:function(a){if(!this.videoElement.loop){this.isEnded=true}},startMovie:function(){if(this.videoElement){this.videoElement.play();this.isPlaying=true}},stopMovie:function(){if(this.videoElement){this.videoElement.pause()}},hideMoviePoster:function(a){var b=a.style;b.visibility="hidden";b.display="none";if(a.parentNode){a.parentNode.removeChild(a)}}});var KPFCssRenderer=Class.create({initialize:function(b,d,a,c){this.textureId=b.textureId;this.nativeWidth=b.bounds.width;this.nativeHeight=b.bounds.height;this.opacity=b.opacity;this.visibility=b.hidden===true?"hidden":"visible";this.textureTransform=b.textureTransform;this.affineTransform=b.affineTransform;this.anchorPoint=b.anchorPoint;this.contentsRect=b.contentsRect;this.layer=b;this.sceneIndex=d;this.animationSupported=a;this.enableCompositingUsingBackface=false;this.enablePreserve3DFromParent=false;if(c.length>0){this.initRendererFlags(c[0])}this.glContentsRenderer={};this.domNode=document.createElement("div");this.domNode.setAttribute("id","layer"+b.layerId)},initRendererFlags:function(a){if(a.type==="transition"&&a.name!="apple:ca-swing"&&a.name!="com.apple.iWork.Keynote.BLTSwoosh"){this.enableCompositingUsingBackface=true;this.enablePreserve3DFromParent=true;if(isChrome&&(a.name==="apple:ca-push"||a.name==="com.apple.iWork.Keynote.BLTFadeThruColor")){this.enableCompositingUsingBackface=false;this.enablePreserve3DFromParent=false}}else{this.enableCompositingUsingBackface=false;this.enablePreserve3DFromParent=false}if(a.name==="apple:apple-grid"){this.isGridTransition=true}else{if(a.name==="com.apple.iWork.Keynote.BLTMosaicFlip"){this.isMosaicTransition=true}else{if(a.name==="com.apple.iWork.Keynote.BLTSwoosh"&&a.type==="transition"){this.isSwooshTransition=true}}}},destroy:function(){this.textureId=null;this.nativeWidth=null;this.nativeHeight=null;this.opacity=null;this.visibility=null;this.textureTransform=null;this.affineTransform=null;this.anchorPoint=null;this.textureAnimation=null;this.contentsRect=null;this.requiresPerspectiveTransform=null;this.sceneIndex=null;var d=this.domNode.getElementsByTagName("canvas");for(var c=d.length;c--;){var a=d[c];if(a){var b=a.getContext("2d");if(b){b.clearRect(0,0,a.width,a.height);d[c].remove()}}}if(this.domNode.hasChildNodes()){while(this.domNode.childNodes.length>0){this.domNode.removeChild(this.domNode.firstChild)}}this.domNode=null},addAnimationNode:function(e,d,a,c){if(d==null){return e}var f=d.shift();if(f==null){return e}var h=document.createElement("div");var g=a+"-"+escapeTextureId(f);h.setAttribute("id",g);if(c.initialState.masksToBounds){setElementProperty(h,"overflow","hidden")}if(this.enableCompositingUsingBackface){setElementProperty(h,kBackfaceVisibilityPropertyName,"hidden")}else{if(this.isSwooshTransition){setElementProperty(h,kTransformPropertyName,"translateZ(0px)")}}this.setStyle(h,"0px","0px",e.style.width,e.style.height,kPositionAbsolutePropertyValue,null,null);setElementProperty(h,kTransformStylePropertyName,kTransformStylePreserve3DPropertyValue);if(c.anchorPoint.pointX!=0.5||c.anchorPoint.pointY!=0.5){setElementProperty(h,kTransformOriginPropertyName,(c.anchorPoint.pointX*100)+"% "+(c.anchorPoint.pointY*100)+"%")}var b=["opacity","doubleSided","anchorPointZ"];if(c.transformOriginValue&&c.transformOriginZValue){if(c.animationInfo.name==="apple:ca-revolve"){b.push("anchorPoint","position","zPosition")}else{if(c.animationInfo.name==="apple:3D-cube"){b.push("anchorPoint","position","zPosition","transform.rotation.x","transform.rotation.y")}}}if(c.transformOriginZValue&&b.indexOf(f)===-1){if(Prototype.Browser.Gecko){setElementProperty(h,kTransformOriginPropertyName,(c.anchorPoint.pointX*100)+"% "+(c.anchorPoint.pointY*100)+"% "+c.transformOriginZValue+"px")}else{setElementProperty(h,kTransformOriginZPropertyName,c.transformOriginZValue+"px");if(navigator.userAgent.lastIndexOf("Chrome/")<=0){setElementProperty(h,kTransformPropertyName,"translateZ("+c.transformOriginZValue+"px)")}}}e.appendChild(h);return this.addAnimationNode(h,d,a,c)},createNodes:function(a,d,c){var b=gShowController.movieCache;if(b&&c.animationInfo.name!=="renderMovie"){this.setVideoLayer(c,b)}var e=this.addNode(a,d,c);return e},setVideoLayer:function(l,p){var a=l.objectID;var o=a+"-video";kpfMovie=p[o];if(!kpfMovie){for(var h=0,b=l.layers.length;h0&&d>0){ap.drawImage(F,0,0)}this.setStyle(p,"0px","0px",s+"px",U+"px",kPositionAbsolutePropertyValue,null,null)}else{var n=O*d;var X=(Q+R)*a;var c=(O+ad)*d;var k=Q*a;var u=p.width=X-k;var j=p.height=c-n;ap.drawImage(F,k*pdfScaleFactor,n*pdfScaleFactor,u*pdfScaleFactor,j*pdfScaleFactor,0,0,u,j);this.setStyle(p,"0px","0px",u+"px",j+"px",kPositionAbsolutePropertyValue,null,null)}var L=p;L.setAttribute("id",M);if(browserPrefix==="webkit"&&f.isTransition==null){if(S){setElementProperty(L,kTransformPropertyName,"rotateY(180deg) translateZ(0px)")}else{setElementProperty(L,kTransformPropertyName,"translateZ(0px)")}}if(f.isTransition){if(isChrome){if(this.enableCompositingUsingBackface){if(!this.isGridTransition&&!this.isMosaicTransition){setElementProperty(L,kBackfaceVisibilityPropertyName,"hidden")}}else{if(this.isSwooshTransition){setElementProperty(L,kTransformPropertyName,"translateZ(0px)")}}}else{if(this.enableCompositingUsingBackface){setElementProperty(L,kBackfaceVisibilityPropertyName,"hidden")}else{setElementProperty(L,kTransformPropertyName,"translateZ(0px)")}}}var K=v.objectID;var g=v&&v.type==="buildOut";var W;var t;if(f.isVideoLayer){if(v.name==="renderMovie"){var Y=z.getMovieUrl(this.sceneIndex,v.movie.asset);var P=/(?:\.([^.]+))?$/;var ah=P.exec(Y)[1];if(ah==="gif"){t=new Image();this.setStyle(t,"0px","0px",s+"px",U+"px",kPositionAbsolutePropertyValue,null,null);Event.observe(t,"load",this.hideElement.bind(this,L));t.src=Y}else{if(gShowController.movieCache==null){gShowController.movieCache={}}var V=K+"-video";f.hasMovie=true;f.movieId=V;W=gShowController.movieCache[V];if(W==null){var ag={objectID:K,movieId:V,width:s,height:U,sceneIndex:this.sceneIndex,textureId:M,src:Y,showControls:gShowController.isRecording===false?true:false,movieDiv:ae,parentLayer:E};W=new KPFMovie(ag);gShowController.movieCache[V]=W;W.observeEvents(L)}}}else{var Z=gShowController.movieCache;if(Z){var V=f.movieObjectID+"-video";W=Z[V]}}}if(f.hasContentsAnimation){var an=f.cssAnimation.animations;var T;var e;for(var m=0,ab=an.length;m1&&I>1&&J!==0&&I!==0){this.setStyle(N,"0px","0px",a+"px",d+"px",kPositionAbsolutePropertyValue,null,null);setElementProperty(N,kTransformOriginPropertyName,"0% 0%");setElementProperty(N,kTransformPropertyName,"scale("+1/J+","+1/I+")")}else{this.setStyle(N,"0px","0px",s+"px",U+"px",kPositionAbsolutePropertyValue,null,null)}var B=document.createElement("div");B.id=G+"-contents-to";this.setStyle(B,"0px","0px",s+"px",U+"px",kPositionAbsolutePropertyValue,null,null);B.appendChild(N);H.appendChild(B);setElementProperty(B,"opacity",0);var D=z.getTextureObject(this.sceneIndex,e);var q=document.createElement("canvas");var aj=q.getContext("2d");q.width=D.width;q.height=D.height;aj.drawImage(D,0,0);q.setAttribute("id",e);this.setStyle(q,"0px","0px",s+"px",U+"px",kPositionAbsolutePropertyValue,null,null);var l=document.createElement("div");l.id=G+"-contents-from";this.setStyle(l,"0px","0px",s+"px",U+"px",kPositionAbsolutePropertyValue,null,null);l.appendChild(q);H.appendChild(l)}else{H.appendChild(L);if(t){H.appendChild(t)}}if(W){if(W.isFirstRendered){H.insertBefore(W.videoElement,L);W.isFirstRendered=false}else{if(f.animationInfo&&f.animationInfo.name!=="renderMovie"){if(W.objectID===K&&g){W.stopMovie();W.removeControls();W.isBuiltOut=true}else{if(!W.isBuiltOut){H.parentNode.appendChild(W.movieDiv);H.style.visibility="hidden"}}}}}}else{if(f.initialState.backgroundColor){var aa=f.initialState.backgroundColor;setElementProperty(H,"background-color","rgba("+parseInt(aa[0]*255)+","+parseInt(aa[1]*255)+","+parseInt(aa[2]*255)+","+aa[3]+")")}}for(var ac=0,A=f.layers.length;acc.duration){c.duration=b.cssAnimation.overallEndTime}}for(var a=0,d=b.layers.length;a0){var g=k?"layer"+k.layerId:"layer"+b.layerId;var d=document.getElementById(g);if(d){this.applyCssAnimation(d,b,k,q)}else{if(q.currentKPFLayer){g="layer"+q.currentKPFLayer.layerId;if(q.currentKPFLayer.layers[0]){g="layer"+q.currentKPFLayer.layers[0].layerId}d=document.getElementById(g);if(d){this.applyCssAnimation(d,b,q.currentKPFLayer,q)}}}}else{if(b.isRenderMovie&&b.animationInfo.name==="renderMovie"){var j=gShowController.movieCache;if(j){var p=j[m];if(p){if(e.loopMode&&e.loopMode==="looping"){p.setLoop(true)}if(e.volume){p.setVolume(e.volume)}p.startMovie()}}}if(k){var a=document.getElementById("layer"+k.layerId);var l=window.getComputedStyle(a,null);var n=l.getPropertyValue(kTransformPropertyName);var f=parseTransformMatrix(n);var o="matrix("+f[0]+","+f[1]+","+f[2]+","+f[3]+","+b.bounds.offset.pointX+","+b.bounds.offset.pointY+")";if(q.name==="apple:action-motion-path"){setElementProperty(a,kTransformPropertyName,o)}}}for(var h=0,c=b.layers.length;h0){if(isIE){for(var ab=0,E=v.cssRules.length;ab0){ai=kTransformPropertyName;aa="translateZ("+-h.transformOriginZValue+"px)"}else{ai=kTransformPropertyName;aa="translateZ("+h.transformOriginZValue+"px)"}}}if(G!=="hidden"){setElementProperty(c,ai,aa)}setElementProperty(c,kAnimationFillModePropertyName,J.fillMode==="removed"?"none":J.fillMode);setElementProperty(c,kAnimationNamePropertyName,R);setElementProperty(c,kAnimationDurationPropertyName,n);if(d>1&&(h.animationInfo.name==="apple:action-blink"||h.animationInfo.name==="apple:action-pulse")){setElementProperty(c,kAnimationIterationCountPropertyName,d)}}}},animateContentsWillBegin:function(d){var c=d.canvasId;var i=d.effect;var e=d.element;var g=this.glContentsRenderer[c];g.draw(i);if(!g.animationStarted){g.animate();g.animationStarted=true}var b=e.id+"-contents-from";var a=e.id+"-contents-to";var h=document.getElementById(b);var f=document.getElementById(a);setElementProperty(h,"opacity",0);setElementProperty(f,"opacity",0)},cssPropertyValueForActionValue:function(a,b){switch(a){case"hidden":if(b.scalar===true){return"hidden"}else{return"visible"}case"anchorPoint":return b.pointX+"% "+b.pointY+"%";case"anchorPointZ":return b.scalar;case"position":return"translate("+b.pointX+"px,"+b.pointY+"px)";case"zPosition":return"translateZ("+b.scalar+"px)";case"translationEmphasis":return"translateX("+b.translationEmphasis[0]+"px) translateY("+b.translationEmphasis[1]+"px) translateZ("+b.translationEmphasis[2]+")";case"rotationEmphasis":return"rotateZ("+b.rotationEmphasis[6]+"rad)";case"scaleEmphasis":return"scale3d("+ensureScaleFactorNotZero(b.scaleEmphasis[3])+","+ensureScaleFactorNotZero(b.scaleEmphasis[4])+","+ensureScaleFactorNotZero(b.scaleEmphasis[5])+")";case"transform.scale":case"transform.scale.xy":return"scale("+ensureScaleFactorNotZero(b.scalar)+")";case"transform.scale.x":return"scaleX("+ensureScaleFactorNotZero(b.scalar)+")";case"transform.scale.y":return"scaleY("+ensureScaleFactorNotZero(b.scalar)+")";case"transform.rotation.x":return"rotateX("+b.scalar+"rad)";case"transform.rotation.y":return"rotateY("+b.scalar+"rad)";case"transform.rotation.z":case"transform.rotation":return"rotateZ("+b.scalar+"rad)";case"transform.translation":return"translateX("+b.pointX+"px) translateY("+b.pointY+"px)";case"transform.translation.x":return"translateX("+b.scalar+"px)";case"transform.translation.y":return"translateY("+b.scalar+"px)";case"transform.translation.z":return"translateZ("+b.scalar+"px)";case"isPlaying":case"opacity":case"opacityMultiplier":return b.scalar+"";case"transform":return"matrix3d("+b.transform+")";case"doubleSided":if(b.scalar===false){return"hidden"}else{return"visible"}default:return"some value"}},cssPropertyNameForAction:function(a){switch(a){case"hidden":return kVisibilityPropertyName;case"anchorPoint":return kTransformOriginPropertyName;case"anchorPointZ":return kTransformOriginZPropertyName;case"opacityMultiplier":return kOpacityPropertyName;case"translationEmphasis":case"rotationEmphasis":case"scaleEmphasis":case"position":case"zPosition":case"transform":case"transform.scale":case"transform.scale.xy":case"transform.scale.x":case"transform.scale.y":case"transform.rotation.x":case"transform.rotation.y":case"transform.rotation.z":case"transform.rotation":case"transform.translation":case"transform.translation.x":case"transform.translation.y":case"transform.translation.z":case"bounds":return kTransformPropertyName;case"doubleSided":return kBackfaceVisibilityPropertyName;case"contents":return kBackgroundImagePropertyName;default:return a}},hideMoviePoster:function(a){a.style.visibility="hidden"},handleMovieDidStart:function(a,b){b.style.visibility="visible";setTimeout(this.hideMoviePoster.bind(this,a),120)},handleMovieDidEnd:function(a,b){if(!b.loop){b.isEnded=true}},startMovie:function(a){if(a){a.play();a.isPlaying=true}},stopMovie:function(a){if(a){a.pause()}}});var KPFLayer=Class.create({initialize:function(c,d,b){this.animationInfo=d;this.layerId=kpfLayerCounter;kpfLayerCounter=kpfLayerCounter+1;this.objectID=c.objectID!=null?c.objectID:null;this.textureId=c.texture?c.texture:null;this.animations=c.animations;this.initialState=c.initialState;this.isVideoLayer=c.isVideoLayer;this.hasHighlightedBulletAnimation=c.hasHighlightedBulletAnimation;this.texturedRectangle=c.texturedRectangle;this.cssAnimationRules=[];this.layers=[];this.affineTransform=this.initialState.affineTransform;this.position=this.initialState.position;this.textureTransform="";if(this.initialState.transform!=null&&this.initialState.transform!=undefined){this.textureTransform="matrix3D("+this.initialState.transform+")"}else{this.textureTransform="matrix("+this.affineTransform+")"}this.anchorPoint=this.initialState.anchorPoint;if(b==null){b={pointX:0,pointY:0}}var a=this.position.pointX-this.initialState.width/2-(this.anchorPoint.pointX-0.5)*this.initialState.width;var e=this.position.pointY-this.initialState.height/2-(this.anchorPoint.pointY-0.5)*this.initialState.height;a=Math.round(a*1000000)/1000000;e=Math.round(e*1000000)/1000000;this.bounds={width:this.initialState.width,height:this.initialState.height,origin:{pointX:this.affineTransform[4],pointY:this.affineTransform[5]},offset:{pointX:a,pointY:e},canvasOffset:{pointX:a+b.pointX,pointY:e+b.pointY}};this.sublayerTransform=this.initialState.sublayerTransform;this.contentsRect=this.initialState.contentsRect;this.hidden=this.initialState.hidden;this.opacity=this.initialState.opacity;this.visibility=this.hidden===true?"hidden":"visible";this.addSublayer(c.layers,d,this.bounds.offset);if(d.animationSupported){this.initLayerAnimations()}},destroy:function(){this.initialState=null;this.cssAnimationRules=null;this.affineTransform=null;this.textureTransform=null;this.anchorPoint=null;this.anchorPointZ=null;this.bounds=null;this.contentsRect=null;this.hidden=null;this.opacity=null},addSublayer:function(f,e,d){for(var a=0,b=f.length;a-1){this.isEmphasisBuild=true}}}}if(this.animations.length>0){this.cssAnimation=new KPFCssAnimation(this.animations,this)}this.divNames=[];if(this.objectID&&this.isRenderMovie){this.divNames=["opacity","position","transform.rotation.z","transform.scale.x","transform.scale.y","bounds","contents"]}else{if(this.cssAnimation){for(var z in this.cssAnimation.keyAnimations){if(q.indexOf(z)>0){continue}if(z=="opacity"){h=true}else{if(z==="anchorPoint"){b=true}else{if(z==="anchorPointZ"){s=true}else{if(!e&&z==="transform.translation.x"){g=true}else{if(!e&&z==="transform.translation.y"){f=true}else{if(!e&&z==="transform.translation.z"){d=true}else{if(!e&&z==="transform.translation"){a=true}else{if(!e&&z==="transform.rotation.x"){p=true}else{if(!e&&z==="transform.rotation.y"){o=true}else{if(!e&&z==="transform.rotation.z"){m=true}else{if(!e&&z==="transform.rotation"){u=true}else{if(z==="transform.scale.x"){x=true}else{if(z==="transform.scale.y"){w=true}else{if(z==="transform.scale.xy"){c=true}else{if(z==="transform.scale"){y=true}else{if(z==="transform"){r=true}else{if(z==="doubleSided"){l=true}else{if(z==="contents"){this.hasContentsAnimation=true}else{if(z==="bounds"){this.hasBoundsAnimation=true}else{if(z==="position"){this.hasPosition=true}else{t.push(z)}}}}}}}}}}}}}}}}}}}}}if(h&&this.isActionBuild&&!this.isEmphasisBuild){this.divNames.push("opacity");for(var v=0,j=this.layers.length;vthis.overallEndTime){this.overallEndTime=w}if(d=="custom"){H=F.timingControlPoint1x;G=F.timingControlPoint1y;l=F.timingControlPoint2x;f=F.timingControlPoint2y}if(F.animations!=null&&F.animations.length>0){var q=F.animations;var p=v;if(q[0].property==null){p=q[0].beginTime;q=q[0].animations}for(var z=0,e=q.length;zB.latestEndTime){B.latestEndTime=p+a.beginTime+a.duration}if(a.path){var E=F.path.length;for(var x=0;CB.latestEndTime){B.latestEndTime=F.beginTime+F.duration}if(F.path){var E=F.path.length;for(var x=0;x0){l=100*d/this.overallEndTime;j=100*g/this.overallEndTime}if(j>99.9999){j=100}var f={startKeyframe:l,endKeyframe:j,from:c.from,to:c.to,timingFunction:c.timingFunction};if(c.fillMode){f.fillMode=c.fillMode}if(c.timingFunction=="custom"){f.timingControlPoint1x=c.timingControlPoint1x;f.timingControlPoint1y=c.timingControlPoint1y;f.timingControlPoint2x=c.timingControlPoint2x;f.timingControlPoint2y=c.timingControlPoint2y}m.push(f);m.sort(this.sortAction)}},sortAction:function(b,a){return b.startKeyframe-a.startKeyframe},roundNum:function(a){return Math.round(a*this.kRoundingFactor)/this.kRoundingFactor},createAnimationRules:function(w){var f=this.kDelta;for(var h in this.keyAnimations){if(h=="playing"){continue}var q=this.keyAnimations[h];var g=q.keyActions;var j=false;q.keyframes=[];var o=g[0];var s=this.roundNum(o.startKeyframe);var m=this.roundNum(100*q.groupBeginTime/this.overallEndTime);if(h=="anchorPoint"){var c={};c.x=o.to.pointX;c.y=o.to.pointY;var n={pointX:-(o.from.pointX-w.anchorPoint.pointX)*w.bounds.width,pointY:-(o.from.pointY-w.anchorPoint.pointY)*w.bounds.height};if(w.isMagicMove){var u=this.anchorPointOffset(w,{x:o.from.pointX,y:o.from.pointY});var k={pointX:u.x,pointY:u.y};var d=this.anchorPointOffset(w,{x:o.to.pointX,y:o.to.pointY});var v={pointX:d.x,pointY:d.y};if(k.pointX!==v.pointX||k.pointY!=v.pointY){n={pointX:v.pointX-k.pointX,pointY:v.pointY-k.pointY};w.magicMoveOffsetValue=n}}if(s!=0){var t={pointX:0,pointY:0};if(m>0){this.insertInitialKeyframes(q,m-f,"position",t)}if(s-m>f){if(o.fillMode==="both"||o.fillMode==="backwards"){t=n}q.keyframes.push({keyframe:m,keyName:"position",value:t,timingFunction:"linear"});q.keyframes.push({keyframe:s-f,keyName:"position",value:t,timingFunction:"linear"})}}q.keyframes.push({keyframe:s,keyName:"position",value:n,timingFunction:"linear"});q.keyframes.push({keyframe:100,keyName:"position",value:n,timingFunction:"linear"});w.transformOriginValue=(c.x*100)+"% "+(c.y*100)+"%";continue}if(h=="anchorPointZ"){j=true;if(s!=0){var t=this.createInitialKeyframeValue(w,h,o.from,true);q.keyframes.push({keyframe:0,keyName:"zPosition",value:t,timingFunction:"linear"});q.keyframes.push({keyframe:s-f,keyName:"zPosition",value:t,timingFunction:"linear"})}q.keyframes.push({keyframe:s,keyName:"zPosition",value:o.from,timingFunction:"linear"});q.keyframes.push({keyframe:100,keyName:"zPosition",value:o.to,timingFunction:"linear"});w.transformOriginZValue=o.to.scalar;continue}if(o==null){continue}var l=0;var r=null;var e=null;if(s!=0){if(h==="hidden"){e={scalar:w.hidden};this.insertInitialKeyframes(q,s-f,h,e)}else{if(h==="opacity"){if(o.fillMode==="both"||o.fillMode==="backwards"){e=o.from}else{e={scalar:w.opacity}}this.insertInitialKeyframes(q,s-f,h,e)}else{if(h==="position"){if(w.isBuildIn||w.isBuildOut){if(m>0&&o.fillMode!=="both"&&o.fillMode!=="backwards"){e={pointX:0,pointY:0}}else{e={pointX:this.roundNum(o.from.pointX-w.initialState.position.pointX),pointY:this.roundNum(o.from.pointY-w.initialState.position.pointY)}}}else{e={pointX:0,pointY:0}}this.insertInitialKeyframes(q,s-f,h,e)}else{e=this.createInitialKeyframeValue(w,h,o.from,j);if(m>0){this.insertInitialKeyframes(q,m-f,h,e)}if(s-m>f){if(o.fillMode==="both"||o.fillMode==="backwards"){e=o.from}if(h==="transform.translation"){e.pointX=this.roundNum(e.pointX);e.pointY=this.roundNum(e.pointY)}q.keyframes.push({keyframe:m,keyName:h,value:e,timingFunction:"linear"});q.keyframes.push({keyframe:s-f,keyName:h,value:e,timingFunction:"linear"})}}}}l=o.startKeyframe;r=e}for(var p=0,b=g.length;pf){q.keyframes.push({keyframe:this.roundNum(o.startKeyframe)-f,keyName:h,value:r,timingFunction:"linear"})}if(h==="transform.translation"){o.from.pointX=this.roundNum(o.from.pointX);o.from.pointY=this.roundNum(o.from.pointY);o.to.pointX=this.roundNum(o.to.pointX);o.to.pointY=this.roundNum(o.to.pointY)}var a=this.createTimingFunctionForAction(o);q.keyframes.push({keyframe:this.roundNum(o.startKeyframe),keyName:h,value:o.from,timingFunction:a});q.keyframes.push({keyframe:this.roundNum(o.endKeyframe)-(o.endKeyframe==100?0:f),keyName:h,value:o.to,timingFunction:a});r=o.to;l=o.endKeyframe}if(l!=100&&h!="hidden"){q.keyframes.push({keyframe:this.roundNum(l),keyName:h,value:r,timingFunction:"linear"});q.keyframes.push({keyframe:100,keyName:h,value:r,timingFunction:"linear"})}}},insertInitialKeyframes:function(b,c,d,a){b.keyframes.push({keyframe:0,keyName:d,value:a,timingFunction:"linear"});b.keyframes.push({keyframe:c,keyName:d,value:a,timingFunction:"linear"})},anchorPointOffset:function(c,e){var a={};var b={};var f={};var d=c.bounds;a.x=d.width/2;a.y=d.height/2;b.x=e.x*d.width;b.y=e.y*d.height;f.x=(a.x-b.x);f.y=(a.y-b.y);return f},createInitialKeyframeValue:function(a,c,e,b){var d={};switch(c){case"anchorPoint":d.pointX=(a.anchorPoint.pointX-0.5)*a.bounds.width;d.pointY=(a.anchorPoint.pointY-0.5)*a.bounds.height;break;case"anchorPointZ":if(Prototype.Browser.Gecko||Prototype.Browser.IE||isChrome||isIE||isEdge){d.scalar=0}else{d.scalar=e.scalar+e.scalar}break;case"opacity":case"opacityMultiplier":d.scalar=a.opacity;break;case"hidden":d.scalar=a.hidden;break;case"position":d.pointX=a.affineTransform[4];d.pointY=a.affineTransform[5];break;case"zPosition":d.scalar=0;break;case"transform.scale":case"transform.scale.xy":case"transform.scale.x":case"transform.scale.y":d.scalar=a.initialState.scale;break;case"transform.rotation.z":d.scalar=a.initialState.rotation;case"transform":d.transform=e.transform;break;case"bounds":d.pointX=0;d.pointY=0;d.width=a.initialState.width;d.height=a.initialState.height;break;default:d.scalar=0;d.pointX=0;d.pointY=0;break}return d},createTimingFunctionForAction:function(c){var b="";var a=c.timingFunction;var d=c;if(typeof a==="object"){a=a.timingFunction;d=c.timingFunction}switch(a.toLowerCase()){case"easein":b="ease-in";break;case"easeout":b="ease-out";break;case"easeinout":case"easeineaseout":b="ease-in-out";break;case"custom":b="cubic-bezier("+d.timingControlPoint1x+","+d.timingControlPoint1y+","+d.timingControlPoint2x+","+d.timingControlPoint2y+")";break;case"linear":b="linear";break;default:b="linear";break}return b},createAnimationRuleForKeyframes:function(d){for(var n in this.keyAnimations){var f=this.keyAnimations[n];var e="layer"+d.layerId+"-"+escapeTextureId(n);var b;var h="";var o;if(n==="contents"){var m=this.roundNum(f.keyActions[0].startKeyframe);b=gShowController.animationManager.createAnimation(e+"-from");var l="0% {opacity: 1; "+kAnimationTimingFunctionPropertyName+": linear;}";var k="49.999% {opacity: 1; "+kAnimationTimingFunctionPropertyName+": linear;}";var j="50% {opacity: 0; "+kAnimationTimingFunctionPropertyName+": linear;}";var g="100% {opacity: 0; "+kAnimationTimingFunctionPropertyName+": linear;}";if(m!==0){k=((100-m)/2+m-this.kDelta)-this.kDelta+"% {opacity: 1; "+kAnimationTimingFunctionPropertyName+": linear;}";j=((100-m)/2+m)+"% {opacity: 0; "+kAnimationTimingFunctionPropertyName+": linear;}"}b.appendRule(l);b.appendRule(k);b.appendRule(j);b.appendRule(g);b=gShowController.animationManager.createAnimation(e+"-to");l="0% {opacity: 0; "+kAnimationTimingFunctionPropertyName+": linear;}";k="49.999% {opacity: 0; "+kAnimationTimingFunctionPropertyName+": linear;}";j="50% {opacity: 1; "+kAnimationTimingFunctionPropertyName+": linear;}";g="100% {opacity: 1; "+kAnimationTimingFunctionPropertyName+": linear;}";if(m!==0){k=((100-m)/2+m-this.kDelta)-this.kDelta+"% {opacity: 0; "+kAnimationTimingFunctionPropertyName+": linear;}";j=((100-m)/2+m)+"% {opacity: 1; "+kAnimationTimingFunctionPropertyName+": linear;}"}b.appendRule(l);b.appendRule(k);b.appendRule(j);b.appendRule(g);d.cssAnimationRules.push(e);continue}if(!isIE){b=gShowController.animationManager.createAnimation(e);for(var c=0,a=f.keyframes.length;c=10){for(var c=0,a=f.keyframes.length;c0)){return"translateZ("+-c.scalar+"px)"}else{return"translateZ("+c.scalar+"px)"}case"translationEmphasis":return"translateX("+c.translationEmphasis[0]+"px) translateY("+c.translationEmphasis[1]+"px) translateZ("+c.translationEmphasis[2]+")";case"rotationEmphasis":return"rotateZ("+c.rotationEmphasis[6]+"rad)";case"scaleEmphasis":return"scale3d("+ensureScaleFactorNotZero(c.scaleEmphasis[3])+","+ensureScaleFactorNotZero(c.scaleEmphasis[4])+","+ensureScaleFactorNotZero(c.scaleEmphasis[5])+")";case"transform.scale":case"transform.scale.xy":return"scale("+ensureScaleFactorNotZero(c.scalar)+")";case"transform.scale.x":return"scaleX("+ensureScaleFactorNotZero(c.scalar)+")";case"transform.scale.y":return"scaleY("+ensureScaleFactorNotZero(c.scalar)+")";case"transform.rotation.x":return"rotateX("+c.scalar+"rad)";case"transform.rotation.y":return"rotateY("+c.scalar+"rad)";case"transform.rotation.z":case"transform.rotation":return"rotateZ("+c.scalar+"rad)";case"transform.translation":return"translateX("+c.pointX+"px) translateY("+c.pointY+"px)";case"transform.translation.x":return"translateX("+c.scalar+"px)";case"transform.translation.y":return"translateY("+c.scalar+"px)";case"transform.translation.z":return"translateZ("+c.scalar+"px)";case"isPlaying":case"opacity":case"opacityMultiplier":return c.scalar+"";case"transform":return"matrix3d("+c.transform+")";case"doubleSided":if(c.scalar==false){return"hidden"}else{return"visible"}case"contents":return c.texture;default:return"some value"}},cssPropertyNameForAction:function(a){switch(a){case"hidden":return kVisibilityPropertyName;case"anchorPoint":return kTransformOriginPropertyName;case"anchorPointZ":return kTransformOriginZPropertyName;case"opacityMultiplier":return kOpacityPropertyName;case"translationEmphasis":case"rotationEmphasis":case"scaleEmphasis":case"position":case"zPosition":case"transform":case"transform.scale":case"transform.scale.xy":case"transform.scale.x":case"transform.scale.y":case"transform.rotation.x":case"transform.rotation.y":case"transform.rotation.z":case"transform.rotation":case"transform.translation":case"transform.translation.x":case"transform.translation.y":case"transform.translation.z":case"bounds":return kTransformPropertyName;case"doubleSided":return kBackfaceVisibilityPropertyName;case"contents":return kBackgroundImagePropertyName;default:return a}}});