/*! jelly-quest - 9af049d83ff4 minimified build */ !function(a){"use strict";var b=-1,c={onVisible:function(a){var b=c.isSupported();if(!b||!c.hidden())return a(),b;var d=c.change(function(){c.hidden()||(c.unbind(d),a())});return d},change:function(a){if(!c.isSupported())return!1;b+=1;var d=b;return c._callbacks[d]=a,c._listen(),d},unbind:function(a){delete c._callbacks[a]},afterPrerendering:function(a){var b=c.isSupported(),d="prerender";if(!b||d!=c.state())return a(),b;var e=c.change(function(b,f){d!=f&&(c.unbind(e),a())});return e},hidden:function(){return!(!c._doc.hidden&&!c._doc.webkitHidden)},state:function(){return c._doc.visibilityState||c._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!c._doc.visibilityState&&!c._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(a){var b=c.state();for(var d in c._callbacks)c._callbacks[d].call(c._doc,a,b)},_listen:function(){if(!c._init){var a="visibilitychange";c._doc.webkitVisibilityState&&(a="webkit"+a);var b=function(){c._change.apply(c,arguments)};c._doc.addEventListener?c._doc.addEventListener(a,b):c._doc.attachEvent(a,b),c._init=!0}}};"undefined"!=typeof module&&module.exports?module.exports=c:a.Visibility=c}(this),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype;b.type=null,b.target=null,b.currentTarget=null,b.eventPhase=0,b.bubbles=!1,b.cancelable=!1,b.timeStamp=0,b.defaultPrevented=!1,b.propagationStopped=!1,b.immediatePropagationStopped=!1,b.removed=!1,b.initialize=function(a,b,c){this.type=a,this.bubbles=b,this.cancelable=c,this.timeStamp=(new Date).getTime()},b.preventDefault=function(){this.defaultPrevented=!0},b.stopPropagation=function(){this.propagationStopped=!0},b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},b.remove=function(){this.removed=!0},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)},b.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){},b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.on=b.on,a.removeEventListener=a.off=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent,a._dispatchEvent=b._dispatchEvent,a.willTrigger=b.willTrigger},b._listeners=null,b._captureListeners=null,b.initialize=function(){},b.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},b.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},b.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},b.off=b.removeEventListener,b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},b.dispatchEvent=function(a,b){if("string"==typeof a){var c=this._listeners;if(!c||!c[a])return!1;a=new createjs.Event(a)}if(a.target=b||this,a.bubbles&&this.parent){for(var d=this,e=[d];d.parent;)e.push(d=d.parent);var f,g=e.length;for(f=g-1;f>=0&&!a.propagationStopped;f--)e[f]._dispatchEvent(a,1+(0==f));for(f=1;g>f&&!a.propagationStopped;f++)e[f]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return a.defaultPrevented},b.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},b.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},b.toString=function(){return"[EventDispatcher]"},b._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;a.currentTarget=this,a.eventPhase=b,a.removed=!1,e=e.slice();for(var f=0;c>f&&!a.immediatePropagationStopped;f++){var g=e[f];g.handleEvent?g.handleEvent(a):g(a),a.removed&&(this.off(a.type,g,1==b),a.removed=!1)}}},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){"use strict";createjs.indexOf=function(a,b){for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1}}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){throw"UID cannot be instantiated"};a._nextID=0,a.get=function(){return a._nextID++},createjs.UID=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){throw"Ticker cannot be instantiated."};a.RAF_SYNCHED="synched",a.RAF="raf",a.TIMEOUT="timeout",a.useRAF=!1,a.timingMode=null,a.maxDelta=0,a.removeEventListener=null,a.removeAllEventListeners=null,a.dispatchEvent=null,a.hasEventListener=null,a._listeners=null,createjs.EventDispatcher.initialize(a),a._addEventListener=a.addEventListener,a.addEventListener=function(){return!a._inited&&a.init(),a._addEventListener.apply(a,arguments)},a._paused=!1,a._inited=!1,a._startTime=0,a._pausedTime=0,a._ticks=0,a._pausedTicks=0,a._interval=50,a._lastTime=0,a._times=null,a._tickTimes=null,a._timerId=null,a._raf=!0,a.init=function(){a._inited||(a._inited=!0,a._times=[],a._tickTimes=[],a._startTime=a._getTime(),a._times.push(a._lastTime=0),a.setInterval(a._interval))},a.reset=function(){if(a._raf){var b=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;b&&b(a._timerId)}else clearTimeout(a._timerId);a.removeAllEventListeners("tick")},a.setInterval=function(b){a._interval=b,a._inited&&a._setupTick()},a.getInterval=function(){return a._interval},a.setFPS=function(b){a.setInterval(1e3/b)},a.getFPS=function(){return 1e3/a._interval},a.getMeasuredTickTime=function(b){var c=0,d=a._tickTimes;if(d.length<1)return-1;b=Math.min(d.length,b||0|a.getFPS());for(var e=0;b>e;e++)c+=d[e];return c/b},a.getMeasuredFPS=function(b){var c=a._times;return c.length<2?-1:(b=Math.min(c.length-1,b||0|a.getFPS()),1e3/((c[0]-c[b])/b))},a.setPaused=function(b){a._paused=b},a.getPaused=function(){return a._paused},a.getTime=function(b){return a._getTime()-a._startTime-(b?a._pausedTime:0)},a.getEventTime=function(b){return(a._lastTime||a._startTime)-(b?a._pausedTime:0)},a.getTicks=function(b){return a._ticks-(b?a._pausedTicks:0)},a._handleSynch=function(){var b=a._getTime()-a._startTime;a._timerId=null,a._setupTick(),b-a._lastTime>=.97*(a._interval-1)&&a._tick()},a._handleRAF=function(){a._timerId=null,a._setupTick(),a._tick()},a._handleTimeout=function(){a._timerId=null,a._setupTick(),a._tick()},a._setupTick=function(){if(null==a._timerId){var b=a.timingMode||a.useRAF&&a.RAF_SYNCHED;if(b==a.RAF_SYNCHED||b==a.RAF){var c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(c)return a._timerId=c(b==a.RAF?a._handleRAF:a._handleSynch),void(a._raf=!0)}a._raf=!1,a._timerId=setTimeout(a._handleTimeout,a._interval)}},a._tick=function(){var b=a._getTime()-a._startTime,c=b-a._lastTime,d=a._paused;if(a._ticks++,d&&(a._pausedTicks++,a._pausedTime+=c),a._lastTime=b,a.hasEventListener("tick")){var e=new createjs.Event("tick"),f=a.maxDelta;e.delta=f&&c>f?f:c,e.paused=d,e.time=b,e.runTime=b-a._pausedTime,a.dispatchEvent(e)}for(a._tickTimes.unshift(a._getTime()-b);a._tickTimes.length>100;)a._tickTimes.pop();for(a._times.unshift(b);a._times.length>100;)a._times.pop()};var b=window.performance&&(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow);a._getTime=function(){return b&&b.call(performance)||(new Date).getTime()},createjs.Ticker=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d,e,f,g,h,i,j){this.initialize(a,b,c,d,e,f,g,h,i,j)},b=a.prototype=new createjs.Event;b.stageX=0,b.stageY=0,b.rawX=0,b.rawY=0,b.nativeEvent=null,b.pointerID=0,b.primary=!1,b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b._get_localX=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).x},b._get_localY=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).y};try{Object.defineProperties(b,{localX:{get:b._get_localX},localY:{get:b._get_localY}})}catch(c){}b.Event_initialize=b.initialize,b.initialize=function(a,b,c,d,e,f,g,h,i,j){this.Event_initialize(a,b,c),this.stageX=d,this.stageY=e,this.nativeEvent=f,this.pointerID=g,this.primary=h,this.rawX=null==i?d:i,this.rawY=null==j?e:j},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable,this.stageX,this.stageY,this.target,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)},b.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"},createjs.MouseEvent=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d,e,f){this.initialize(a,b,c,d,e,f)},b=a.prototype;a.identity=null,a.DEG_TO_RAD=Math.PI/180,b.a=1,b.b=0,b.c=0,b.d=1,b.tx=0,b.ty=0,b.alpha=1,b.shadow=null,b.compositeOperation=null,b.initialize=function(a,b,c,d,e,f){return this.a=null==a?1:a,this.b=b||0,this.c=c||0,this.d=null==d?1:d,this.tx=e||0,this.ty=f||0,this},b.prepend=function(a,b,c,d,e,f){var g=this.tx;if(1!=a||0!=b||0!=c||1!=d){var h=this.a,i=this.c;this.a=h*a+this.b*c,this.b=h*b+this.b*d,this.c=i*a+this.d*c,this.d=i*b+this.d*d}return this.tx=g*a+this.ty*c+e,this.ty=g*b+this.ty*d+f,this},b.append=function(a,b,c,d,e,f){var g=this.a,h=this.b,i=this.c,j=this.d;return this.a=a*g+b*i,this.b=a*h+b*j,this.c=c*g+d*i,this.d=c*h+d*j,this.tx=e*g+f*i+this.tx,this.ty=e*h+f*j+this.ty,this},b.prependMatrix=function(a){return this.prepend(a.a,a.b,a.c,a.d,a.tx,a.ty),this.prependProperties(a.alpha,a.shadow,a.compositeOperation),this},b.appendMatrix=function(a){return this.append(a.a,a.b,a.c,a.d,a.tx,a.ty),this.appendProperties(a.alpha,a.shadow,a.compositeOperation),this},b.prependTransform=function(b,c,d,e,f,g,h,i,j){if(f%360)var k=f*a.DEG_TO_RAD,l=Math.cos(k),m=Math.sin(k);else l=1,m=0;return(i||j)&&(this.tx-=i,this.ty-=j),g||h?(g*=a.DEG_TO_RAD,h*=a.DEG_TO_RAD,this.prepend(l*d,m*d,-m*e,l*e,0,0),this.prepend(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,c)):this.prepend(l*d,m*d,-m*e,l*e,b,c),this},b.appendTransform=function(b,c,d,e,f,g,h,i,j){if(f%360)var k=f*a.DEG_TO_RAD,l=Math.cos(k),m=Math.sin(k);else l=1,m=0;return g||h?(g*=a.DEG_TO_RAD,h*=a.DEG_TO_RAD,this.append(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,c),this.append(l*d,m*d,-m*e,l*e,0,0)):this.append(l*d,m*d,-m*e,l*e,b,c),(i||j)&&(this.tx-=i*this.a+j*this.c,this.ty-=i*this.b+j*this.d),this},b.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},b.skew=function(b,c){return b*=a.DEG_TO_RAD,c*=a.DEG_TO_RAD,this.append(Math.cos(c),Math.sin(c),-Math.sin(b),Math.cos(b),0,0),this},b.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},b.translate=function(a,b){return this.tx+=a,this.ty+=b,this},b.identity=function(){return this.alpha=this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this.shadow=this.compositeOperation=null,this},b.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;return this.a=d/f,this.b=-b/f,this.c=-c/f,this.d=a/f,this.tx=(c*this.ty-d*e)/f,this.ty=-(a*this.ty-b*e)/f,this},b.isIdentity=function(){return 0==this.tx&&0==this.ty&&1==this.a&&0==this.b&&0==this.c&&1==this.d},b.transformPoint=function(a,b,c){return c=c||{},c.x=a*this.a+b*this.c+this.tx,c.y=a*this.b+b*this.d+this.ty,c},b.decompose=function(b){null==b&&(b={}),b.x=this.tx,b.y=this.ty,b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b),b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var c=Math.atan2(-this.c,this.d),d=Math.atan2(this.b,this.a);return c==d?(b.rotation=d/a.DEG_TO_RAD,this.a<0&&this.d>=0&&(b.rotation+=b.rotation<=0?180:-180),b.skewX=b.skewY=0):(b.skewX=c/a.DEG_TO_RAD,b.skewY=d/a.DEG_TO_RAD),b},b.reinitialize=function(a,b,c,d,e,f,g,h,i){return this.initialize(a,b,c,d,e,f),this.alpha=null==g?1:g,this.shadow=h,this.compositeOperation=i,this},b.copy=function(a){return this.reinitialize(a.a,a.b,a.c,a.d,a.tx,a.ty,a.alpha,a.shadow,a.compositeOperation)},b.appendProperties=function(a,b,c){return this.alpha*=a,this.shadow=b||this.shadow,this.compositeOperation=c||this.compositeOperation,this},b.prependProperties=function(a,b,c){return this.alpha*=a,this.shadow=this.shadow||b,this.compositeOperation=this.compositeOperation||c,this},b.clone=function(){return(new a).copy(this)},b.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"},a.identity=new a,createjs.Matrix2D=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b){this.initialize(a,b)},b=a.prototype;b.x=0,b.y=0,b.initialize=function(a,b){return this.x=null==a?0:a,this.y=null==b?0:b,this},b.copy=function(a){return this.initialize(a.x,a.y)},b.clone=function(){return new a(this.x,this.y)},b.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"},createjs.Point=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d){this.initialize(a,b,c,d)},b=a.prototype;b.x=0,b.y=0,b.width=0,b.height=0,b.initialize=function(a,b,c,d){return this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this},b.copy=function(a){return this.initialize(a.x,a.y,a.width,a.height)},b.clone=function(){return new a(this.x,this.y,this.width,this.height)},b.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"},createjs.Rectangle=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d,e,f,g){this.initialize(a,b,c,d,e,f,g)},b=a.prototype;b.target=null,b.overLabel=null,b.outLabel=null,b.downLabel=null,b.play=!1,b._isPressed=!1,b._isOver=!1,b.initialize=function(a,b,c,d,e,f,g){a.addEventListener&&(this.target=a,a.cursor="pointer",this.overLabel=null==c?"over":c,this.outLabel=null==b?"out":b,this.downLabel=null==d?"down":d,this.play=e,this.setEnabled(!0),this.handleEvent({}),f&&(g&&(f.actionsEnabled=!1,f.gotoAndStop&&f.gotoAndStop(g)),a.hitArea=f))},b.setEnabled=function(a){var b=this.target;a?(b.addEventListener("rollover",this),b.addEventListener("rollout",this),b.addEventListener("mousedown",this),b.addEventListener("pressup",this)):(b.removeEventListener("rollover",this),b.removeEventListener("rollout",this),b.removeEventListener("mousedown",this),b.removeEventListener("pressup",this))},b.toString=function(){return"[ButtonHelper]"},b.handleEvent=function(a){var b,c=this.target,d=a.type;"mousedown"==d?(this._isPressed=!0,b=this.downLabel):"pressup"==d?(this._isPressed=!1,b=this._isOver?this.overLabel:this.outLabel):"rollover"==d?(this._isOver=!0,b=this._isPressed?this.downLabel:this.overLabel):(this._isOver=!1,b=this._isPressed?this.overLabel:this.outLabel),this.play?c.gotoAndPlay&&c.gotoAndPlay(b):c.gotoAndStop&&c.gotoAndStop(b)},createjs.ButtonHelper=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d){this.initialize(a,b,c,d)},b=a.prototype;a.identity=null,b.color=null,b.offsetX=0,b.offsetY=0,b.blur=0,b.initialize=function(a,b,c,d){this.color=a,this.offsetX=b,this.offsetY=c,this.blur=d},b.toString=function(){return"[Shadow]"},b.clone=function(){return new a(this.color,this.offsetX,this.offsetY,this.blur)},a.identity=new a("transparent",0,0,0),createjs.Shadow=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a){this.initialize(a)},b=a.prototype=new createjs.EventDispatcher;b.complete=!0,b.framerate=0,b._animations=null,b._frames=null,b._images=null,b._data=null,b._loadCount=0,b._frameHeight=0,b._frameWidth=0,b._numFrames=0,b._regX=0,b._regY=0,b.initialize=function(a){var b,c,d,e;if(null!=a){if(this.framerate=a.framerate||0,a.images&&(c=a.images.length)>0)for(e=this._images=[],b=0;c>b;b++){var f=a.images[b];if("string"==typeof f){var g=f;f=document.createElement("img"),f.src=g}e.push(f),f.getContext||f.complete||(this._loadCount++,this.complete=!1,function(a){f.onload=function(){a._handleImageLoad()}}(this))}if(null==a.frames);else if(a.frames instanceof Array)for(this._frames=[],e=a.frames,b=0,c=e.length;c>b;b++){var h=e[b];this._frames.push({image:this._images[h[4]?h[4]:0],rect:new createjs.Rectangle(h[0],h[1],h[2],h[3]),regX:h[5]||0,regY:h[6]||0})}else d=a.frames,this._frameWidth=d.width,this._frameHeight=d.height,this._regX=d.regX||0,this._regY=d.regY||0,this._numFrames=d.count,0==this._loadCount&&this._calculateFrames();if(this._animations=[],null!=(d=a.animations)){this._data={};var i;for(i in d){var j={name:i},k=d[i];if("number"==typeof k)e=j.frames=[k];else if(k instanceof Array)if(1==k.length)j.frames=[k[0]];else for(j.speed=k[3],j.next=k[2],e=j.frames=[],b=k[0];b<=k[1];b++)e.push(b);else{j.speed=k.speed,j.next=k.next;var l=k.frames;e=j.frames="number"==typeof l?[l]:l.slice(0)}(j.next===!0||void 0===j.next)&&(j.next=i),(j.next===!1||e.length<2&&j.next==i)&&(j.next=null),j.speed||(j.speed=1),this._animations.push(i),this._data[i]=j}}}},b.getNumFrames=function(a){if(null==a)return this._frames?this._frames.length:this._numFrames;var b=this._data[a];return null==b?0:b.frames.length},b.getAnimations=function(){return this._animations.slice(0)},b.getAnimation=function(a){return this._data[a]},b.getFrame=function(a){var b;return this._frames&&(b=this._frames[a])?b:null},b.getFrameBounds=function(a,b){var c=this.getFrame(a);return c?(b||new createjs.Rectangle).initialize(-c.regX,-c.regY,c.rect.width,c.rect.height):null},b.toString=function(){return"[SpriteSheet]"},b.clone=function(){var b=new a;return b.complete=this.complete,b._animations=this._animations,b._frames=this._frames,b._images=this._images,b._data=this._data,b._frameHeight=this._frameHeight,b._frameWidth=this._frameWidth,b._numFrames=this._numFrames,b._loadCount=this._loadCount,b},b._handleImageLoad=function(){0==--this._loadCount&&(this._calculateFrames(),this.complete=!0,this.dispatchEvent("complete"))},b._calculateFrames=function(){if(!this._frames&&0!=this._frameWidth){this._frames=[];for(var a=0,b=this._frameWidth,c=this._frameHeight,d=0,e=this._images;d0?Math.min(this._numFrames-a,g*h):g*h,j=0;i>j;j++)this._frames.push({image:f,rect:new createjs.Rectangle(j%g*b,(0|j/g)*c,b,c),regX:this._regX,regY:this._regY});a+=i}this._numFrames=a}},createjs.SpriteSheet=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c){this.f=a,this.params=b,this.path=null==c?!0:c}a.prototype.exec=function(a){this.f.apply(a,this.params)};var b=function(){this.initialize()},c=b.prototype;b.getRGB=function(a,b,c,d){return null!=a&&null==c&&(d=b,c=255&a,b=255&a>>8,a=255&a>>16),null==d?"rgb("+a+","+b+","+c+")":"rgba("+a+","+b+","+c+","+d+")"},b.getHSL=function(a,b,c,d){return null==d?"hsl("+a%360+","+b+"%,"+c+"%)":"hsla("+a%360+","+b+"%,"+c+"%,"+d+")"},b.Command=a,b.BASE_64={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63},b.STROKE_CAPS_MAP=["butt","round","square"],b.STROKE_JOINTS_MAP=["miter","round","bevel"];var d=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");if(d.getContext){var e=b._ctx=d.getContext("2d");b.beginCmd=new a(e.beginPath,[],!1),b.fillCmd=new a(e.fill,[],!1),b.strokeCmd=new a(e.stroke,[],!1),d.width=d.height=1}c._strokeInstructions=null,c._strokeStyleInstructions=null,c._strokeIgnoreScale=!1,c._fillInstructions=null,c._fillMatrix=null,c._instructions=null,c._oldInstructions=null,c._activeInstructions=null,c._active=!1,c._dirty=!1,c.initialize=function(){this.clear(),this._ctx=b._ctx},c.isEmpty=function(){return!(this._instructions.length||this._oldInstructions.length||this._activeInstructions.length)},c.draw=function(a){this._dirty&&this._updateInstructions();for(var b=this._instructions,c=0,d=b.length;d>c;c++)b[c].exec(a)},c.drawAsPath=function(a){this._dirty&&this._updateInstructions();for(var b,c=this._instructions,d=0,e=c.length;e>d;d++)((b=c[d]).path||0==d)&&b.exec(a)},c.moveTo=function(b,c){return this._activeInstructions.push(new a(this._ctx.moveTo,[b,c])),this},c.lineTo=function(b,c){return this._dirty=this._active=!0,this._activeInstructions.push(new a(this._ctx.lineTo,[b,c])),this},c.arcTo=function(b,c,d,e,f){return this._dirty=this._active=!0,this._activeInstructions.push(new a(this._ctx.arcTo,[b,c,d,e,f])),this},c.arc=function(b,c,d,e,f,g){return this._dirty=this._active=!0,null==g&&(g=!1),this._activeInstructions.push(new a(this._ctx.arc,[b,c,d,e,f,g])),this},c.quadraticCurveTo=function(b,c,d,e){return this._dirty=this._active=!0,this._activeInstructions.push(new a(this._ctx.quadraticCurveTo,[b,c,d,e])),this},c.bezierCurveTo=function(b,c,d,e,f,g){return this._dirty=this._active=!0,this._activeInstructions.push(new a(this._ctx.bezierCurveTo,[b,c,d,e,f,g])),this},c.rect=function(b,c,d,e){return this._dirty=this._active=!0,this._activeInstructions.push(new a(this._ctx.rect,[b,c,d,e])),this},c.closePath=function(){return this._active&&(this._dirty=!0,this._activeInstructions.push(new a(this._ctx.closePath,[]))),this},c.clear=function(){return this._instructions=[],this._oldInstructions=[],this._activeInstructions=[],this._strokeStyleInstructions=this._strokeInstructions=this._fillInstructions=this._fillMatrix=null,this._active=this._dirty=this._strokeIgnoreScale=!1,this},c.beginFill=function(b){return this._active&&this._newPath(),this._fillInstructions=b?[new a(this._setProp,["fillStyle",b],!1)]:null,this._fillMatrix=null,this},c.beginLinearGradientFill=function(b,c,d,e,f,g){this._active&&this._newPath();for(var h=this._ctx.createLinearGradient(d,e,f,g),i=0,j=b.length;j>i;i++)h.addColorStop(c[i],b[i]);return this._fillInstructions=[new a(this._setProp,["fillStyle",h],!1)],this._fillMatrix=null,this},c.beginRadialGradientFill=function(b,c,d,e,f,g,h,i){this._active&&this._newPath();for(var j=this._ctx.createRadialGradient(d,e,f,g,h,i),k=0,l=b.length;l>k;k++)j.addColorStop(c[k],b[k]);return this._fillInstructions=[new a(this._setProp,["fillStyle",j],!1)],this._fillMatrix=null,this},c.beginBitmapFill=function(b,c,d){this._active&&this._newPath(),c=c||"";var e=this._ctx.createPattern(b,c);return this._fillInstructions=[new a(this._setProp,["fillStyle",e],!1)],this._fillMatrix=d?[d.a,d.b,d.c,d.d,d.tx,d.ty]:null,this},c.endFill=function(){return this.beginFill()},c.setStrokeStyle=function(c,d,e,f,g){return this._active&&this._newPath(),this._strokeStyleInstructions=[new a(this._setProp,["lineWidth",null==c?"1":c],!1),new a(this._setProp,["lineCap",null==d?"butt":isNaN(d)?d:b.STROKE_CAPS_MAP[d]],!1),new a(this._setProp,["lineJoin",null==e?"miter":isNaN(e)?e:b.STROKE_JOINTS_MAP[e]],!1),new a(this._setProp,["miterLimit",null==f?"10":f],!1)],this._strokeIgnoreScale=g,this},c.beginStroke=function(b){return this._active&&this._newPath(),this._strokeInstructions=b?[new a(this._setProp,["strokeStyle",b],!1)]:null,this},c.beginLinearGradientStroke=function(b,c,d,e,f,g){this._active&&this._newPath();for(var h=this._ctx.createLinearGradient(d,e,f,g),i=0,j=b.length;j>i;i++)h.addColorStop(c[i],b[i]);return this._strokeInstructions=[new a(this._setProp,["strokeStyle",h],!1)],this},c.beginRadialGradientStroke=function(b,c,d,e,f,g,h,i){this._active&&this._newPath();for(var j=this._ctx.createRadialGradient(d,e,f,g,h,i),k=0,l=b.length;l>k;k++)j.addColorStop(c[k],b[k]);return this._strokeInstructions=[new a(this._setProp,["strokeStyle",j],!1)],this},c.beginBitmapStroke=function(b,c){this._active&&this._newPath(),c=c||"";var d=this._ctx.createPattern(b,c);return this._strokeInstructions=[new a(this._setProp,["strokeStyle",d],!1)],this},c.endStroke=function(){return this.beginStroke(),this},c.curveTo=c.quadraticCurveTo,c.drawRect=c.rect,c.drawRoundRect=function(a,b,c,d,e){return this.drawRoundRectComplex(a,b,c,d,e,e,e,e),this},c.drawRoundRectComplex=function(b,c,d,e,f,g,h,i){var j=(e>d?d:e)/2,k=0,l=0,m=0,n=0;0>f&&(f*=k=-1),f>j&&(f=j),0>g&&(g*=l=-1),g>j&&(g=j),0>h&&(h*=m=-1),h>j&&(h=j),0>i&&(i*=n=-1),i>j&&(i=j),this._dirty=this._active=!0;var o=this._ctx.arcTo,p=this._ctx.lineTo;return this._activeInstructions.push(new a(this._ctx.moveTo,[b+d-g,c]),new a(o,[b+d+g*l,c-g*l,b+d,c+g,g]),new a(p,[b+d,c+e-h]),new a(o,[b+d+h*m,c+e+h*m,b+d-h,c+e,h]),new a(p,[b+i,c+e]),new a(o,[b-i*n,c+e+i*n,b,c+e-i,i]),new a(p,[b,c+f]),new a(o,[b-f*k,c-f*k,b+f,c,f]),new a(this._ctx.closePath)),this},c.drawCircle=function(a,b,c){return this.arc(a,b,c,0,2*Math.PI),this},c.drawEllipse=function(b,c,d,e){this._dirty=this._active=!0;var f=.5522848,g=d/2*f,h=e/2*f,i=b+d,j=c+e,k=b+d/2,l=c+e/2;return this._activeInstructions.push(new a(this._ctx.moveTo,[b,l]),new a(this._ctx.bezierCurveTo,[b,l-h,k-g,c,k,c]),new a(this._ctx.bezierCurveTo,[k+g,c,i,l-h,i,l]),new a(this._ctx.bezierCurveTo,[i,l+h,k+g,j,k,j]),new a(this._ctx.bezierCurveTo,[k-g,j,b,l+h,b,l])),this},c.inject=function(b,c){return this._dirty=this._active=!0,this._activeInstructions.push(new a(b,[c])),this},c.drawPolyStar=function(b,c,d,e,f,g){this._dirty=this._active=!0,null==f&&(f=0),f=1-f,null==g?g=0:g/=180/Math.PI;var h=Math.PI/e;this._activeInstructions.push(new a(this._ctx.moveTo,[b+Math.cos(g)*d,c+Math.sin(g)*d]));for(var i=0;e>i;i++)g+=h,1!=f&&this._activeInstructions.push(new a(this._ctx.lineTo,[b+Math.cos(g)*d*f,c+Math.sin(g)*d*f])),g+=h,this._activeInstructions.push(new a(this._ctx.lineTo,[b+Math.cos(g)*d,c+Math.sin(g)*d]));return this},c.decodePath=function(a){for(var c=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo,this.closePath],d=[2,2,4,6,0],e=0,f=a.length,g=[],h=0,i=0,j=b.BASE_64;f>e;){var k=a.charAt(e),l=j[k],m=l>>3,n=c[m];if(!n||3&l)throw"bad path data (@"+e+"): "+k;var o=d[m];m||(h=i=0),g.length=0,e++;for(var p=(1&l>>2)+2,q=0;o>q;q++){var r=j[a.charAt(e)],s=r>>5?-1:1;r=(31&r)<<6|j[a.charAt(e+1)],3==p&&(r=r<<6|j[a.charAt(e+2)]),r=s*r/10,q%2?h=r+=h:i=r+=i,g[q]=r,e+=p}n.apply(this,g)}return this},c.clone=function(){var a=new b;return a._instructions=this._instructions.slice(),a._activeInstructions=this._activeInstructions.slice(),a._oldInstructions=this._oldInstructions.slice(),this._fillInstructions&&(a._fillInstructions=this._fillInstructions.slice()),this._strokeInstructions&&(a._strokeInstructions=this._strokeInstructions.slice()),this._strokeStyleInstructions&&(a._strokeStyleInstructions=this._strokeStyleInstructions.slice()),a._active=this._active,a._dirty=this._dirty,a._fillMatrix=this._fillMatrix,a._strokeIgnoreScale=this._strokeIgnoreScale,a},c.toString=function(){return"[Graphics]"},c.mt=c.moveTo,c.lt=c.lineTo,c.at=c.arcTo,c.bt=c.bezierCurveTo,c.qt=c.quadraticCurveTo,c.a=c.arc,c.r=c.rect,c.cp=c.closePath,c.c=c.clear,c.f=c.beginFill,c.lf=c.beginLinearGradientFill,c.rf=c.beginRadialGradientFill,c.bf=c.beginBitmapFill,c.ef=c.endFill,c.ss=c.setStrokeStyle,c.s=c.beginStroke,c.ls=c.beginLinearGradientStroke,c.rs=c.beginRadialGradientStroke,c.bs=c.beginBitmapStroke,c.es=c.endStroke,c.dr=c.drawRect,c.rr=c.drawRoundRect,c.rc=c.drawRoundRectComplex,c.dc=c.drawCircle,c.de=c.drawEllipse,c.dp=c.drawPolyStar,c.p=c.decodePath,c._updateInstructions=function(){this._instructions=this._oldInstructions.slice(),this._instructions.push(b.beginCmd),this._appendInstructions(this._fillInstructions),this._appendInstructions(this._strokeInstructions),this._appendInstructions(this._strokeInstructions&&this._strokeStyleInstructions),this._appendInstructions(this._activeInstructions),this._fillInstructions&&this._appendDraw(b.fillCmd,this._fillMatrix),this._strokeInstructions&&this._appendDraw(b.strokeCmd,this._strokeIgnoreScale&&[1,0,0,1,0,0])},c._appendInstructions=function(a){a&&this._instructions.push.apply(this._instructions,a)},c._appendDraw=function(b,c){c?this._instructions.push(new a(this._ctx.save,[],!1),new a(this._ctx.transform,c,!1),b,new a(this._ctx.restore,[],!1)):this._instructions.push(b)},c._newPath=function(){this._dirty&&this._updateInstructions(),this._oldInstructions=this._instructions,this._activeInstructions=[],this._active=this._dirty=!1},c._setProp=function(a,b){this[a]=b},createjs.Graphics=b}(),this.createjs=this.createjs||{},function(){var a=function(){this.initialize()},b=a.prototype=new createjs.EventDispatcher;a._MOUSE_EVENTS=["click","dblclick","mousedown","mouseout","mouseover","pressmove","pressup","rollout","rollover"],a.suppressCrossDomainErrors=!1;var c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");c.getContext&&(a._hitTestCanvas=c,a._hitTestContext=c.getContext("2d"),c.width=c.height=1),a._nextCacheID=1,b.alpha=1,b.cacheCanvas=null,b.id=-1,b.mouseEnabled=!0,b.tickEnabled=!0,b.name=null,b.parent=null,b.regX=0,b.regY=0,b.rotation=0,b.scaleX=1,b.scaleY=1,b.skewX=0,b.skewY=0,b.shadow=null,b.visible=!0,b.x=0,b.y=0,b.compositeOperation=null,b.snapToPixel=!1,b.filters=null,b.cacheID=0,b.mask=null,b.hitArea=null,b.cursor=null,b._cacheOffsetX=0,b._cacheOffsetY=0,b._cacheScale=1,b._cacheDataURLID=0,b._cacheDataURL=null,b._matrix=null,b._rectangle=null,b._bounds=null,b.initialize=function(){this.id=createjs.UID.get(),this._matrix=new createjs.Matrix2D,this._rectangle=new createjs.Rectangle},b.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},b.draw=function(a,b){var c=this.cacheCanvas;if(b||!c)return!1;var d,e=this._cacheScale,f=this._cacheOffsetX,g=this._cacheOffsetY;return(d=this._applyFilterBounds(f,g,0,0))&&(f=d.x,g=d.y),a.drawImage(c,f,g,c.width/e,c.height/e),!0},b.updateContext=function(a){var b,c=this.mask,d=this;c&&c.graphics&&!c.graphics.isEmpty()&&(b=c.getMatrix(c._matrix),a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty),c.graphics.drawAsPath(a),a.clip(),b.invert(),a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty)),b=d._matrix.identity().appendTransform(d.x,d.y,d.scaleX,d.scaleY,d.rotation,d.skewX,d.skewY,d.regX,d.regY),createjs.Stage._snapToPixelEnabled&&d.snapToPixel?a.transform(b.a,b.b,b.c,b.d,0|b.tx+.5,0|b.ty+.5):a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty),a.globalAlpha*=d.alpha,d.compositeOperation&&(a.globalCompositeOperation=d.compositeOperation),d.shadow&&this._applyShadow(a,d.shadow)},b.cache=function(a,b,c,d,e){e=e||1,this.cacheCanvas||(this.cacheCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),this._cacheWidth=c,this._cacheHeight=d,this._cacheOffsetX=a,this._cacheOffsetY=b,this._cacheScale=e,this.updateCache()},b.updateCache=function(b){var c,d=this.cacheCanvas,e=this._cacheScale,f=this._cacheOffsetX*e,g=this._cacheOffsetY*e,h=this._cacheWidth,i=this._cacheHeight;if(!d)throw"cache() must be called before updateCache()";var j=d.getContext("2d");(c=this._applyFilterBounds(f,g,h,i))&&(f=c.x,g=c.y,h=c.width,i=c.height),h=Math.ceil(h*e),i=Math.ceil(i*e),h!=d.width||i!=d.height?(d.width=h,d.height=i):b||j.clearRect(0,0,h+1,i+1),j.save(),j.globalCompositeOperation=b,j.setTransform(e,0,0,e,-f,-g),this.draw(j,!0),this._applyFilters(),j.restore(),this.cacheID=a._nextCacheID++},b.uncache=function(){this._cacheDataURL=this.cacheCanvas=null,this.cacheID=this._cacheOffsetX=this._cacheOffsetY=0,this._cacheScale=1},b.getCacheDataURL=function(){return this.cacheCanvas?(this.cacheID!=this._cacheDataURLID&&(this._cacheDataURL=this.cacheCanvas.toDataURL()),this._cacheDataURL):null},b.getStage=function(){for(var a=this;a.parent;)a=a.parent;return a instanceof createjs.Stage?a:null },b.localToGlobal=function(a,b){var c=this.getConcatenatedMatrix(this._matrix);return null==c?null:(c.append(1,0,0,1,a,b),new createjs.Point(c.tx,c.ty))},b.globalToLocal=function(a,b){var c=this.getConcatenatedMatrix(this._matrix);return null==c?null:(c.invert(),c.append(1,0,0,1,a,b),new createjs.Point(c.tx,c.ty))},b.localToLocal=function(a,b,c){var d=this.localToGlobal(a,b);return c.globalToLocal(d.x,d.y)},b.setTransform=function(a,b,c,d,e,f,g,h,i){return this.x=a||0,this.y=b||0,this.scaleX=null==c?1:c,this.scaleY=null==d?1:d,this.rotation=e||0,this.skewX=f||0,this.skewY=g||0,this.regX=h||0,this.regY=i||0,this},b.getMatrix=function(a){var b=this;return(a?a.identity():new createjs.Matrix2D).appendTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,b.regX,b.regY).appendProperties(b.alpha,b.shadow,b.compositeOperation)},b.getConcatenatedMatrix=function(a){a?a.identity():a=new createjs.Matrix2D;for(var b=this;null!=b;)a.prependTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,b.regX,b.regY).prependProperties(b.alpha,b.shadow,b.compositeOperation),b=b.parent;return a},b.hitTest=function(b,c){var d=a._hitTestContext;d.setTransform(1,0,0,1,-b,-c),this.draw(d);var e=this._testHit(d);return d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,2,2),e},b.set=function(a){for(var b in a)this[b]=a[b];return this},b.getBounds=function(){if(this._bounds)return this._rectangle.copy(this._bounds);var a=this.cacheCanvas;if(a){var b=this._cacheScale;return this._rectangle.initialize(this._cacheOffsetX,this._cacheOffsetY,a.width/b,a.height/b)}return null},b.getTransformedBounds=function(){return this._getBounds()},b.setBounds=function(a,b,c,d){null==a&&(this._bounds=a),this._bounds=(this._bounds||new createjs.Rectangle).initialize(a,b,c,d)},b.clone=function(){var b=new a;return this.cloneProps(b),b},b.toString=function(){return"[DisplayObject (name="+this.name+")]"},b.cloneProps=function(a){a.alpha=this.alpha,a.name=this.name,a.regX=this.regX,a.regY=this.regY,a.rotation=this.rotation,a.scaleX=this.scaleX,a.scaleY=this.scaleY,a.shadow=this.shadow,a.skewX=this.skewX,a.skewY=this.skewY,a.visible=this.visible,a.x=this.x,a.y=this.y,a._bounds=this._bounds,a.mouseEnabled=this.mouseEnabled,a.compositeOperation=this.compositeOperation},b._applyShadow=function(a,b){b=b||Shadow.identity,a.shadowColor=b.color,a.shadowOffsetX=b.offsetX,a.shadowOffsetY=b.offsetY,a.shadowBlur=b.blur},b._tick=function(a){var b=this._listeners;if(b&&b.tick){var c=new createjs.Event("tick");c.params=a,this._dispatchEvent(c,this,2)}},b._testHit=function(b){try{var c=b.getImageData(0,0,1,1).data[3]>1}catch(d){if(!a.suppressCrossDomainErrors)throw"An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."}return c},b._applyFilters=function(){if(this.filters&&0!=this.filters.length&&this.cacheCanvas)for(var a=this.filters.length,b=this.cacheCanvas.getContext("2d"),c=this.cacheCanvas.width,d=this.cacheCanvas.height,e=0;a>e;e++)this.filters[e].applyFilter(b,0,0,c,d)},b._applyFilterBounds=function(a,b,c,d){var e,f,g=this.filters;if(!g||!(f=g.length))return null;for(var h=0;f>h;h++){var i=this.filters[h],j=i.getBounds&&i.getBounds();j&&(e||(e=this._rectangle.initialize(a,b,c,d)),e.x+=j.x,e.y+=j.y,e.width+=j.width,e.height+=j.height)}return e},b._getBounds=function(a,b){return this._transformBounds(this.getBounds(),a,b)},b._transformBounds=function(a,b,c){if(!a)return a;var d=a.x,e=a.y,f=a.width,g=a.height,h=c?this._matrix.identity():this.getMatrix(this._matrix);(d||e)&&h.appendTransform(0,0,1,1,0,0,0,-d,-e),b&&h.prependMatrix(b);var i=f*h.a,j=f*h.b,k=g*h.c,l=g*h.d,m=h.tx,n=h.ty,o=m,p=m,q=n,r=n;return(d=i+m)p&&(p=d),(d=i+k+m)p&&(p=d),(d=k+m)p&&(p=d),(e=j+n)r&&(r=e),(e=j+l+n)r&&(r=e),(e=l+n)r&&(r=e),a.initialize(o,q,p-o,r-q)},b._hasMouseEventListener=function(){for(var b=a._MOUSE_EVENTS,c=0,d=b.length;d>c;c++)if(this.hasEventListener(b[c]))return!0;return!!this.cursor},createjs.DisplayObject=a}(),this.createjs=this.createjs||{},function(){var a=function(){this.initialize()},b=a.prototype=new createjs.DisplayObject;b.children=null,b.mouseChildren=!0,b.tickChildren=!0,b.DisplayObject_initialize=b.initialize,b.initialize=function(){this.DisplayObject_initialize(),this.children=[]},b.isVisible=function(){var a=this.cacheCanvas||this.children.length;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.DisplayObject_draw=b.draw,b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;for(var c=this.children.slice(0),d=0,e=c.length;e>d;d++){var f=c[d];f.isVisible()&&(a.save(),f.updateContext(a),f.draw(a),a.restore())}return!0},b.addChild=function(a){if(null==a)return a;var b=arguments.length;if(b>1){for(var c=0;b>c;c++)this.addChild(arguments[c]);return arguments[b-1]}return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.push(a),a},b.addChildAt=function(a,b){var c=arguments.length,d=arguments[c-1];if(0>d||d>this.children.length)return arguments[c-2];if(c>2){for(var e=0;c-1>e;e++)this.addChildAt(arguments[e],d+e);return arguments[c-2]}return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),a},b.removeChild=function(a){var b=arguments.length;if(b>1){for(var c=!0,d=0;b>d;d++)c=c&&this.removeChild(arguments[d]);return c}return this.removeChildAt(createjs.indexOf(this.children,a))},b.removeChildAt=function(a){var b=arguments.length;if(b>1){for(var c=[],d=0;b>d;d++)c[d]=arguments[d];c.sort(function(a,b){return b-a});for(var e=!0,d=0;b>d;d++)e=e&&this.removeChildAt(c[d]);return e}if(0>a||a>this.children.length-1)return!1;var f=this.children[a];return f&&(f.parent=null),this.children.splice(a,1),!0},b.removeAllChildren=function(){for(var a=this.children;a.length;)a.pop().parent=null},b.getChildAt=function(a){return this.children[a]},b.getChildByName=function(a){for(var b=this.children,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},b.sortChildren=function(a){this.children.sort(a)},b.getChildIndex=function(a){return createjs.indexOf(this.children,a)},b.getNumChildren=function(){return this.children.length},b.swapChildrenAt=function(a,b){var c=this.children,d=c[a],e=c[b];d&&e&&(c[a]=e,c[b]=d)},b.swapChildren=function(a,b){for(var c,d,e=this.children,f=0,g=e.length;g>f&&(e[f]==a&&(c=f),e[f]==b&&(d=f),null==c||null==d);f++);f!=g&&(e[c]=b,e[d]=a)},b.setChildIndex=function(a,b){var c=this.children,d=c.length;if(!(a.parent!=this||0>b||b>=d)){for(var e=0;d>e&&c[e]!=a;e++);e!=d&&e!=b&&(c.splice(e,1),c.splice(b,0,a))}},b.contains=function(a){for(;a;){if(a==this)return!0;a=a.parent}return!1},b.hitTest=function(a,b){return null!=this.getObjectUnderPoint(a,b)},b.getObjectsUnderPoint=function(a,b){var c=[],d=this.localToGlobal(a,b);return this._getObjectsUnderPoint(d.x,d.y,c),c},b.getObjectUnderPoint=function(a,b){var c=this.localToGlobal(a,b);return this._getObjectsUnderPoint(c.x,c.y)},b.DisplayObject_getBounds=b.getBounds,b.getBounds=function(){return this._getBounds(null,!0)},b.getTransformedBounds=function(){return this._getBounds()},b.clone=function(b){var c=new a;if(this.cloneProps(c),b)for(var d=c.children=[],e=0,f=this.children.length;f>e;e++){var g=this.children[e].clone(b);g.parent=c,d.push(g)}return c},b.toString=function(){return"[Container (name="+this.name+")]"},b.DisplayObject__tick=b._tick,b._tick=function(a){if(this.tickChildren)for(var b=this.children.length-1;b>=0;b--){var c=this.children[b];c.tickEnabled&&c._tick&&c._tick(a)}this.DisplayObject__tick(a)},b._getObjectsUnderPoint=function(b,c,d,e,f){var g=createjs.DisplayObject._hitTestContext,h=this._matrix;f=f||e&&this._hasMouseEventListener();for(var i=this.children,j=i.length,k=j-1;k>=0;k--){var l=i[k],m=l.hitArea;if(l.visible&&(m||l.isVisible())&&(!e||l.mouseEnabled))if(!m&&l instanceof a){var n=l._getObjectsUnderPoint(b,c,d,e,f);if(!d&&n)return e&&!this.mouseChildren?this:n}else{if(!f&&!l._hasMouseEventListener())continue;if(l.getConcatenatedMatrix(h),m&&(h.appendTransform(m.x,m.y,m.scaleX,m.scaleY,m.rotation,m.skewX,m.skewY,m.regX,m.regY),h.alpha=m.alpha),g.globalAlpha=h.alpha,g.setTransform(h.a,h.b,h.c,h.d,h.tx-b,h.ty-c),(m||l).draw(g),!this._testHit(g))continue;if(g.setTransform(1,0,0,1,0,0),g.clearRect(0,0,2,2),!d)return e&&!this.mouseChildren?this:l;d.push(l)}}return null},b._getBounds=function(a,b){var c=this.DisplayObject_getBounds();if(c)return this._transformBounds(c,a,b);var d,e,f,g,h=b?this._matrix.identity():this.getMatrix(this._matrix);a&&h.prependMatrix(a);for(var i=this.children.length,j=0;i>j;j++){var k=this.children[j];if(k.visible&&(c=k._getBounds(h))){var l=c.x,m=c.y,n=l+c.width,o=m+c.height;(d>l||null==d)&&(d=l),(n>e||null==e)&&(e=n),(f>m||null==f)&&(f=m),(o>g||null==g)&&(g=o)}}return null==e?null:this._rectangle.initialize(d,f,e-d,g-f)},createjs.Container=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a){this.initialize(a)},b=a.prototype=new createjs.Container;a._snapToPixelEnabled=!1,b.autoClear=!0,b.canvas=null,b.mouseX=0,b.mouseY=0,b.snapToPixelEnabled=!1,b.mouseInBounds=!1,b.tickOnUpdate=!0,b.mouseMoveOutside=!1,b.nextStage=null,b._pointerData=null,b._pointerCount=0,b._primaryPointerID=null,b._mouseOverIntervalID=null,b.Container_initialize=b.initialize,b.initialize=function(a){this.Container_initialize(),this.canvas="string"==typeof a?document.getElementById(a):a,this._pointerData={},this.enableDOMEvents(!0)},b.update=function(){if(this.canvas){this.tickOnUpdate&&(this.dispatchEvent("tickstart"),this.tickEnabled&&this._tick(arguments.length?arguments:null),this.dispatchEvent("tickend")),this.dispatchEvent("drawstart"),a._snapToPixelEnabled=this.snapToPixelEnabled,this.autoClear&&this.clear();var b=this.canvas.getContext("2d");b.save(),this.updateContext(b),this.draw(b,!1),b.restore(),this.dispatchEvent("drawend")}},b.handleEvent=function(a){"tick"==a.type&&this.update(a)},b.clear=function(){if(this.canvas){var a=this.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)}},b.toDataURL=function(a,b){b||(b="image/png");var c,d=this.canvas.getContext("2d"),e=this.canvas.width,f=this.canvas.height;if(a){c=d.getImageData(0,0,e,f);var g=d.globalCompositeOperation;d.globalCompositeOperation="destination-over",d.fillStyle=a,d.fillRect(0,0,e,f)}var h=this.canvas.toDataURL(b);return a&&(d.clearRect(0,0,e+1,f+1),d.putImageData(c,0,0),d.globalCompositeOperation=g),h},b.enableMouseOver=function(a){if(this._mouseOverIntervalID&&(clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=null,0==a&&this._testMouseOver(!0)),null==a)a=20;else if(0>=a)return;var b=this;this._mouseOverIntervalID=setInterval(function(){b._testMouseOver()},1e3/Math.min(50,a))},b.enableDOMEvents=function(a){null==a&&(a=!0);var b,c,d=this._eventListeners;if(!a&&d){for(b in d)c=d[b],c.t.removeEventListener(b,c.f,!1);this._eventListeners=null}else if(a&&!d&&this.canvas){var e=window.addEventListener?window:document,f=this;d=this._eventListeners={},d.mouseup={t:e,f:function(a){f._handleMouseUp(a)}},d.mousemove={t:e,f:function(a){f._handleMouseMove(a)}},d.dblclick={t:this.canvas,f:function(a){f._handleDoubleClick(a)}},d.mousedown={t:this.canvas,f:function(a){f._handleMouseDown(a)}};for(b in d)c=d[b],c.t.addEventListener(b,c.f,!1)}},b.clone=function(){var b=new a(null);return this.cloneProps(b),b},b.toString=function(){return"[Stage (name="+this.name+")]"},b._getElementRect=function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={top:a.offsetTop,left:a.offsetLeft,width:a.offsetWidth,height:a.offsetHeight}}var d=(window.pageXOffset||document.scrollLeft||0)-(document.clientLeft||document.body.clientLeft||0),e=(window.pageYOffset||document.scrollTop||0)-(document.clientTop||document.body.clientTop||0),f=window.getComputedStyle?getComputedStyle(a):a.currentStyle,g=parseInt(f.paddingLeft)+parseInt(f.borderLeftWidth),h=parseInt(f.paddingTop)+parseInt(f.borderTopWidth),i=parseInt(f.paddingRight)+parseInt(f.borderRightWidth),j=parseInt(f.paddingBottom)+parseInt(f.borderBottomWidth);return{left:b.left+d+g,right:b.right+d-i,top:b.top+e+h,bottom:b.bottom+e-j}},b._getPointerData=function(a){var b=this._pointerData[a];return b||(b=this._pointerData[a]={x:0,y:0},null==this._primaryPointerID&&(this._primaryPointerID=a),(null==this._primaryPointerID||-1==this._primaryPointerID)&&(this._primaryPointerID=a)),b},b._handleMouseMove=function(a){a||(a=window.event),this._handlePointerMove(-1,a,a.pageX,a.pageY)},b._handlePointerMove=function(a,b,c,d){if(this.canvas){var e=this._getPointerData(a),f=e.inBounds;if(this._updatePointerPosition(a,b,c,d),f||e.inBounds||this.mouseMoveOutside){-1==a&&e.inBounds==!f&&this._dispatchMouseEvent(this,f?"mouseleave":"mouseenter",!1,a,e,b),this._dispatchMouseEvent(this,"stagemousemove",!1,a,e,b),this._dispatchMouseEvent(e.target,"pressmove",!0,a,e,b);var g=e.event;g&&g.hasEventListener("mousemove")&&g.dispatchEvent(new createjs.MouseEvent("mousemove",!1,!1,e.x,e.y,b,a,a==this._primaryPointerID,e.rawX,e.rawY),e.target),this.nextStage&&this.nextStage._handlePointerMove(a,b,c,d)}}},b._updatePointerPosition=function(a,b,c,d){var e=this._getElementRect(this.canvas);c-=e.left,d-=e.top;var f=this.canvas.width,g=this.canvas.height;c/=(e.right-e.left)/f,d/=(e.bottom-e.top)/g;var h=this._getPointerData(a);(h.inBounds=c>=0&&d>=0&&f-1>=c&&g-1>=d)?(h.x=c,h.y=d):this.mouseMoveOutside&&(h.x=0>c?0:c>f-1?f-1:c,h.y=0>d?0:d>g-1?g-1:d),h.posEvtObj=b,h.rawX=c,h.rawY=d,a==this._primaryPointerID&&(this.mouseX=h.x,this.mouseY=h.y,this.mouseInBounds=h.inBounds)},b._handleMouseUp=function(a){this._handlePointerUp(-1,a,!1)},b._handlePointerUp=function(a,b,c){var d=this._getPointerData(a);this._dispatchMouseEvent(this,"stagemouseup",!1,a,d,b);var e=d.target;e&&(this._getObjectsUnderPoint(d.x,d.y,null,!0)==e&&this._dispatchMouseEvent(e,"click",!0,a,d,b),this._dispatchMouseEvent(e,"pressup",!0,a,d,b));var f=d.event;f&&f.hasEventListener("mouseup")&&f.dispatchEvent(new createjs.MouseEvent("mouseup",!1,!1,d.x,d.y,b,a,a==this._primaryPointerID,d.rawX,d.rawY),e),c?(a==this._primaryPointerID&&(this._primaryPointerID=null),delete this._pointerData[a]):d.event=d.target=null,this.nextStage&&this.nextStage._handlePointerUp(a,b,c)},b._handleMouseDown=function(a){this._handlePointerDown(-1,a,a.pageX,a.pageY)},b._handlePointerDown=function(a,b,c,d){null!=d&&this._updatePointerPosition(a,b,c,d);var e=this._getPointerData(a);this._dispatchMouseEvent(this,"stagemousedown",!1,a,e,b),e.target=this._getObjectsUnderPoint(e.x,e.y,null,!0),e.event=this._dispatchMouseEvent(e.target,"mousedown",!0,a,e,b),this.nextStage&&this.nextStage._handlePointerDown(a,b,c,d)},b._testMouseOver=function(a){if(-1==this._primaryPointerID&&(a||this.mouseX!=this._mouseOverX||this.mouseY!=this._mouseOverY||!this.mouseInBounds)){var b,c,d,e,f=this._getPointerData(-1),g=f.posEvtObj,h=-1,i="";(a||this.mouseInBounds&&g&&g.target==this.canvas)&&(b=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,!0),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY);var j=this._mouseOverTarget||[],k=j[j.length-1],l=this._mouseOverTarget=[];for(c=b;c;)l.unshift(c),null!=c.cursor&&(i=c.cursor),c=c.parent;for(this.canvas.style.cursor=i,d=0,e=l.length;e>d&&l[d]==j[d];d++)h=d;for(k!=b&&this._dispatchMouseEvent(k,"mouseout",!0,-1,f,g),d=j.length-1;d>h;d--)this._dispatchMouseEvent(j[d],"rollout",!1,-1,f,g);for(d=l.length-1;d>h;d--)this._dispatchMouseEvent(l[d],"rollover",!1,-1,f,g);k!=b&&this._dispatchMouseEvent(b,"mouseover",!0,-1,f,g)}},b._handleDoubleClick=function(a){var b=this._getPointerData(-1),c=this._getObjectsUnderPoint(b.x,b.y,null,!0);this._dispatchMouseEvent(c,"dblclick",!0,-1,b,a),this.nextStage&&this.nextStage._handleDoubleClick(a)},b._dispatchMouseEvent=function(a,b,c,d,e,f){if(a&&(c||a.hasEventListener(b))){var g=new createjs.MouseEvent(b,c,!1,e.x,e.y,f,d,d==this._primaryPointerID,e.rawX,e.rawY);return a.dispatchEvent(g),g}},createjs.Stage=a}(),this.createjs=this.createjs||{},function(){var a=function(a){this.initialize(a)},b=a.prototype=new createjs.DisplayObject;b.image=null,b.snapToPixel=!0,b.sourceRect=null,b.DisplayObject_initialize=b.initialize,b.initialize=function(a){this.DisplayObject_initialize(),"string"==typeof a?(this.image=document.createElement("img"),this.image.src=a):this.image=a},b.isVisible=function(){var a=this.cacheCanvas||this.image&&(this.image.complete||this.image.getContext||this.image.readyState>=2);return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.DisplayObject_draw=b.draw,b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;var c=this.sourceRect;return c?a.drawImage(this.image,c.x,c.y,c.width,c.height,0,0,c.width,c.height):a.drawImage(this.image,0,0),!0},b.DisplayObject_getBounds=b.getBounds,b.getBounds=function(){var a=this.DisplayObject_getBounds();if(a)return a;var b=this.sourceRect||this.image,c=this.image&&(this.image.complete||this.image.getContext||this.image.readyState>=2);return c?this._rectangle.initialize(0,0,b.width,b.height):null},b.clone=function(){var b=new a(this.image);return this.sourceRect&&(b.sourceRect=this.sourceRect.clone()),this.cloneProps(b),b},b.toString=function(){return"[Bitmap (name="+this.name+")]"},createjs.Bitmap=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b){this.initialize(a,b)},b=a.prototype=new createjs.DisplayObject;b.currentFrame=0,b.currentAnimation=null,b.paused=!0,b.spriteSheet=null,b.snapToPixel=!0,b.offset=0,b.currentAnimationFrame=0,b.framerate=0,b._advanceCount=0,b._animation=null,b._currentFrame=null,b.DisplayObject_initialize=b.initialize,b.initialize=function(a,b){this.DisplayObject_initialize(),this.spriteSheet=a,b&&this.gotoAndPlay(b)},b.isVisible=function(){var a=this.cacheCanvas||this.spriteSheet.complete;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.DisplayObject_draw=b.draw,b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;this._normalizeFrame();var c=this.spriteSheet.getFrame(0|this._currentFrame);if(!c)return!1;var d=c.rect;return a.drawImage(c.image,d.x,d.y,d.width,d.height,-c.regX,-c.regY,d.width,d.height),!0},b.play=function(){this.paused=!1},b.stop=function(){this.paused=!0},b.gotoAndPlay=function(a){this.paused=!1,this._goto(a)},b.gotoAndStop=function(a){this.paused=!0,this._goto(a)},b.advance=function(a){var b=this._animation&&this._animation.speed||1,c=this.framerate||this.spriteSheet.framerate,d=c&&null!=a?a/(1e3/c):1;this._animation?this.currentAnimationFrame+=d*b:this._currentFrame+=d*b,this._normalizeFrame()},b.DisplayObject_getBounds=b.getBounds,b.getBounds=function(){return this.DisplayObject_getBounds()||this.spriteSheet.getFrameBounds(this.currentFrame,this._rectangle)},b.clone=function(){var b=new a(this.spriteSheet);return this.cloneProps(b),b},b.toString=function(){return"[Sprite (name="+this.name+")]"},b.DisplayObject__tick=b._tick,b._tick=function(a){this.paused||this.advance(a&&a[0]&&a[0].delta),this.DisplayObject__tick(a)},b._normalizeFrame=function(){var a,b=this._animation,c=this.paused,d=this._currentFrame,e=this.currentAnimationFrame;if(b)if(a=b.frames.length,(0|e)>=a){var f=b.next;if(this._dispatchAnimationEnd(b,d,c,f,a-1));else{if(f)return this._goto(f,e-a);this.paused=!0,e=this.currentAnimationFrame=b.frames.length-1,this._currentFrame=b.frames[e]}}else this._currentFrame=b.frames[0|e];else if(a=this.spriteSheet.getNumFrames(),d>=a&&!this._dispatchAnimationEnd(b,d,c,a-1)&&(this._currentFrame-=a)>=a)return this._normalizeFrame();this.currentFrame=0|this._currentFrame},b._dispatchAnimationEnd=function(a,b,c,d,e){var f=a?a.name:null;if(this.hasEventListener("animationend")){var g=new createjs.Event("animationend");g.name=f,g.next=d,this.dispatchEvent(g)}var h=this._animation!=a||this._currentFrame!=b;return h||c||!this.paused||(this.currentAnimationFrame=e,h=!0),h},b.DisplayObject_cloneProps=b.cloneProps,b.cloneProps=function(a){this.DisplayObject_cloneProps(a),a.currentFrame=this.currentFrame,a._currentFrame=this._currentFrame,a.currentAnimation=this.currentAnimation,a.paused=this.paused,a._animation=this._animation,a.currentAnimationFrame=this.currentAnimationFrame,a.framerate=this.framerate},b._goto=function(a,b){if(isNaN(a)){var c=this.spriteSheet.getAnimation(a);c&&(this.currentAnimationFrame=b||0,this._animation=c,this.currentAnimation=a,this._normalizeFrame())}else this.currentAnimationFrame=0,this.currentAnimation=this._animation=null,this._currentFrame=a,this._normalizeFrame()},createjs.Sprite=a}(),this.createjs=this.createjs||{},function(){"use strict";var a="BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.";if(!createjs.Sprite)throw a;(createjs.BitmapAnimation=function(a){this.initialize(a)}).prototype=new createjs.Sprite}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a){this.initialize(a)},b=a.prototype=new createjs.DisplayObject;b.graphics=null,b.DisplayObject_initialize=b.initialize,b.initialize=function(a){this.DisplayObject_initialize(),this.graphics=a?a:new createjs.Graphics},b.isVisible=function(){var a=this.cacheCanvas||this.graphics&&!this.graphics.isEmpty();return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.DisplayObject_draw=b.draw,b.draw=function(a,b){return this.DisplayObject_draw(a,b)?!0:(this.graphics.draw(a),!0)},b.clone=function(b){var c=new a(b&&this.graphics?this.graphics.clone():this.graphics);return this.cloneProps(c),c},b.toString=function(){return"[Shape (name="+this.name+")]"},createjs.Shape=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype=new createjs.DisplayObject,c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");c.getContext&&(a._workingContext=c.getContext("2d"),c.width=c.height=1),a.H_OFFSETS={start:0,left:0,center:-.5,end:-1,right:-1},a.V_OFFSETS={top:0,hanging:-.01,middle:-.4,alphabetic:-.8,ideographic:-.85,bottom:-1},b.text="",b.font=null,b.color=null,b.textAlign="left",b.textBaseline="top",b.maxWidth=null,b.outline=0,b.lineHeight=0,b.lineWidth=null,b.DisplayObject_initialize=b.initialize,b.initialize=function(a,b,c){this.DisplayObject_initialize(),this.text=a,this.font=b,this.color=c},b.isVisible=function(){var a=this.cacheCanvas||null!=this.text&&""!==this.text;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.DisplayObject_draw=b.draw,b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;var c=this.color||"#000";return this.outline?(a.strokeStyle=c,a.lineWidth=1*this.outline):a.fillStyle=c,this._drawText(this._prepContext(a)),!0},b.getMeasuredWidth=function(){return this._prepContext(a._workingContext).measureText(this.text).width},b.getMeasuredLineHeight=function(){return 1.2*this._prepContext(a._workingContext).measureText("M").width},b.getMeasuredHeight=function(){return this._drawText(null,{}).height},b.DisplayObject_getBounds=b.getBounds,b.getBounds=function(){var b=this.DisplayObject_getBounds();if(b)return b;if(null==this.text||""==this.text)return null;var c=this._drawText(null,{}),d=this.maxWidth&&this.maxWidthi;i++){var k=h[i],l=null;if(null!=this.lineWidth&&(l=b.measureText(k).width)>this.lineWidth){var m=k.split(/(\s)/);k=m[0],l=b.measureText(k).width;for(var n=1,o=m.length;o>n;n+=2){var p=b.measureText(m[n]+m[n+1]).width;l+p>this.lineWidth?(d&&this._drawTextLine(b,k,g*e),l>f&&(f=l),k=m[n+1],l=b.measureText(k).width,g++):(k+=m[n]+m[n+1],l+=p)}}d&&this._drawTextLine(b,k,g*e),c&&null==l&&(l=b.measureText(k).width),l>f&&(f=l),g++}return c&&(c.count=g,c.width=f,c.height=g*e),c},b._drawTextLine=function(a,b,c){this.outline?a.strokeText(b,0,c,this.maxWidth||65535):a.fillText(b,0,c,this.maxWidth||65535)},createjs.Text=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.initialize(a,b)}var b=a.prototype=new createjs.DisplayObject;b.text="",b.spriteSheet=null,b.lineHeight=0,b.letterSpacing=0,b.spaceWidth=0,b.DisplayObject_initialize=b.initialize,b.initialize=function(a,b){this.DisplayObject_initialize(),this.text=a,this.spriteSheet=b},b.DisplayObject_draw=b.draw,b.draw=function(a,b){return this.DisplayObject_draw(a,b)?!0:void this._drawText(a)},b.isVisible=function(){var a=this.cacheCanvas||this.spriteSheet&&this.spriteSheet.complete&&this.text;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.getBounds=function(){var a=this._rectangle;return this._drawText(null,a),a.width?a:null},b._getFrame=function(a,b){var c,d=b.getAnimation(a);return d||(a!=(c=a.toUpperCase())||a!=(c=a.toLowerCase())||(c=null),c&&(d=b.getAnimation(c))),d&&b.getFrame(d.frames[0])},b._getLineHeight=function(a){var b=this._getFrame("1",a)||this._getFrame("T",a)||this._getFrame("L",a)||a.getFrame(0);return b?b.rect.height:1},b._getSpaceWidth=function(a){var b=this._getFrame("1",a)||this._getFrame("l",a)||this._getFrame("e",a)||this._getFrame("a",a)||a.getFrame(0);return b?b.rect.width:1},b._drawText=function(a,b){var c,d,e,f=0,g=0,h=this.spaceWidth,i=this.lineHeight,j=this.spriteSheet,k=!!this._getFrame(" ",j);k||0!=h||(h=this._getSpaceWidth(j)),0==i&&(i=this._getLineHeight(j));for(var l=0,m=0,n=this.text.length;n>m;m++){var o=this.text.charAt(m);if(k||" "!=o)if("\n"!=o&&"\r"!=o){var p=this._getFrame(o,j);if(p){var q=p.rect;e=p.regX,c=q.width,a&&a.drawImage(p.image,q.x,q.y,c,d=q.height,f-e,g-p.regY,c,d),f+=c+this.letterSpacing}}else"\r"==o&&"\n"==this.text.charAt(m+1)&&m++,f-e>l&&(l=f-e),f=0,g+=i;else f+=h}f-e>l&&(l=f-e),b&&(b.width=l-this.letterSpacing,b.height=g+i)},createjs.BitmapText=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){throw"SpriteSheetUtils cannot be instantiated"},b=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");b.getContext&&(a._workingCanvas=b,a._workingContext=b.getContext("2d"),b.width=b.height=1),a.addFlippedFrames=function(b,c,d,e){if(c||d||e){var f=0;c&&a._flip(b,++f,!0,!1),d&&a._flip(b,++f,!1,!0),e&&a._flip(b,++f,!0,!0)}},a.extractFrame=function(b,c){isNaN(c)&&(c=b.getAnimation(c).frames[0]);var d=b.getFrame(c);if(!d)return null;var e=d.rect,f=a._workingCanvas;f.width=e.width,f.height=e.height,a._workingContext.drawImage(d.image,e.x,e.y,e.width,e.height,0,0,e.width,e.height);var g=document.createElement("img");return g.src=f.toDataURL("image/png"),g},a.mergeAlpha=function(a,b,c){c||(c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),c.width=Math.max(b.width,a.width),c.height=Math.max(b.height,a.height);var d=c.getContext("2d");return d.save(),d.drawImage(a,0,0),d.globalCompositeOperation="destination-in",d.drawImage(b,0,0),d.restore(),c},a._flip=function(b,c,d,e){for(var f=b._images,g=a._workingCanvas,h=a._workingContext,i=f.length/c,j=0;i>j;j++){var k=f[j];k.__tmp=j,h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,g.width+1,g.height+1),g.width=k.width,g.height=k.height,h.setTransform(d?-1:1,0,0,e?-1:1,d?k.width:0,e?k.height:0),h.drawImage(k,0,0);var l=document.createElement("img");l.src=g.toDataURL("image/png"),l.width=k.width,l.height=k.height,f.push(l)}var m=b._frames,n=m.length/c;for(j=0;n>j;j++){k=m[j];var o=k.rect.clone();l=f[k.image.__tmp+i*c];var p={image:l,rect:o,regX:k.regX,regY:k.regY};d&&(o.x=l.width-o.x-o.width,p.regX=o.width-k.regX),e&&(o.y=l.height-o.y-o.height,p.regY=o.height-k.regY),m.push(p)}var q="_"+(d?"h":"")+(e?"v":""),r=b._animations,s=b._data,t=r.length/c;for(j=0;t>j;j++){var u=r[j];k=s[u];var v={name:u+q,speed:k.speed,next:k.next,frames:[]};k.next&&(v.next+=q),m=k.frames;for(var w=0,x=m.length;x>w;w++)v.frames.push(m[w]+n*c);s[v.name]=v,r.push(v.name)}},createjs.SpriteSheetUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){this.initialize()},b=a.prototype=new createjs.EventDispatcher;a.ERR_DIMENSIONS="frame dimensions exceed max spritesheet dimensions",a.ERR_RUNNING="a build is already running",b.maxWidth=2048,b.maxHeight=2048,b.spriteSheet=null,b.scale=1,b.padding=1,b.timeSlice=.3,b.progress=-1,b._frames=null,b._animations=null,b._data=null,b._nextFrameIndex=0,b._index=0,b._timerID=null,b._scale=1,b.initialize=function(){this._frames=[],this._animations={}},b.addFrame=function(b,c,d,e,f,g){if(this._data)throw a.ERR_RUNNING;var h=c||b.bounds||b.nominalBounds;return!h&&b.getBounds&&(h=b.getBounds()),h?(d=d||1,this._frames.push({source:b,sourceRect:h,scale:d,funct:e,params:f,scope:g,index:this._frames.length,height:h.height*d})-1):null},b.addAnimation=function(b,c,d,e){if(this._data)throw a.ERR_RUNNING;this._animations[b]={frames:c,next:d,frequency:e}},b.addMovieClip=function(b,c,d){if(this._data)throw a.ERR_RUNNING;var e=b.frameBounds,f=c||b.bounds||b.nominalBounds;if(!f&&b.getBounds&&(f=b.getBounds()),!f&&!e)return null;for(var g=this._frames.length,h=b.timeline.duration,i=0;h>i;i++){var j=e&&e[i]?e[i]:f;this.addFrame(b,j,d,function(a){var b=this.actionsEnabled;this.actionsEnabled=!1,this.gotoAndStop(a),this.actionsEnabled=b},[i],b)}var k=b.timeline._labels,l=[];for(var m in k)l.push({index:k[m],label:m});if(l.length){l.sort(function(a,b){return a.index-b.index});for(var i=0,n=l.length;n>i;i++){for(var o=l[i].label,p=g+l[i].index,q=g+(i==n-1?h:l[i+1].index),r=[],s=p;q>s;s++)r.push(s);this.addAnimation(o,r,!0)}}},b.build=function(){if(this._data)throw a.ERR_RUNNING;for(this._startBuild();this._drawNext(););return this._endBuild(),this.spriteSheet},b.buildAsync=function(b){if(this._data)throw a.ERR_RUNNING;this.timeSlice=b,this._startBuild();var c=this;this._timerID=setTimeout(function(){c._run()},50-50*Math.max(.01,Math.min(.99,this.timeSlice||.3)))},b.stopAsync=function(){clearTimeout(this._timerID),this._data=null},b.clone=function(){throw"SpriteSheetBuilder cannot be cloned."},b.toString=function(){return"[SpriteSheetBuilder]"},b._startBuild=function(){var b=this.padding||0;this.progress=0,this.spriteSheet=null,this._index=0,this._scale=this.scale;var c=[];this._data={images:[],frames:c,animations:this._animations};var d=this._frames.slice();if(d.sort(function(a,b){return a.height<=b.height?-1:1}),d[d.length-1].height+2*b>this.maxHeight)throw a.ERR_DIMENSIONS;for(var e=0,f=0,g=0;d.length;){var h=this._fillRow(d,e,g,c,b);if(h.w>f&&(f=h.w),e+=h.h,!h.h||!d.length){var i=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");i.width=this._getSize(f,this.maxWidth),i.height=this._getSize(e,this.maxHeight),this._data.images[g]=i,h.h||(f=e=0,g++)}}},b._getSize=function(a,b){for(var c=4;Math.pow(2,++c)=0;l--){var m=b[l],n=this._scale*m.scale,o=m.sourceRect,p=m.source,q=Math.floor(n*o.x-f),r=Math.floor(n*o.y-f),s=Math.ceil(n*o.height+2*f),t=Math.ceil(n*o.width+2*f);if(t>g)throw a.ERR_DIMENSIONS;s>i||j+t>g||(m.img=d,m.rect=new createjs.Rectangle(j,c,t,s),k=k||s,b.splice(l,1),e[m.index]=[j,c,t,s,d,Math.round(-q+n*p.regX-f),Math.round(-r+n*p.regY-f)],j+=t) }return{w:j,h:k}},b._endBuild=function(){this.spriteSheet=new createjs.SpriteSheet(this._data),this._data=null,this.progress=1,this.dispatchEvent("complete")},b._run=function(){for(var a=50*Math.max(.01,Math.min(.99,this.timeSlice||.3)),b=(new Date).getTime()+a,c=!1;b>(new Date).getTime();)if(!this._drawNext()){c=!0;break}if(c)this._endBuild();else{var d=this;this._timerID=setTimeout(function(){d._run()},50-a)}var e=this.progress=this._index/this._frames.length;if(this.hasEventListener("progress")){var f=new createjs.Event("progress");f.progress=e,this.dispatchEvent(f)}},b._drawNext=function(){var a=this._frames[this._index],b=a.scale*this._scale,c=a.rect,d=a.sourceRect,e=this._data.images[a.img],f=e.getContext("2d");return a.funct&&a.funct.apply(a.scope,a.params),f.save(),f.beginPath(),f.rect(c.x,c.y,c.width,c.height),f.clip(),f.translate(Math.ceil(c.x-d.x*b),Math.ceil(c.y-d.y*b)),f.scale(b,b),a.source.draw(f),f.restore(),++this._indexa)&&(a=0),this.blurX=0|a,(isNaN(b)||0>b)&&(b=0),this.blurY=0|b,(isNaN(c)||1>c)&&(c=1),this.quality=0|c},b.blurX=0,b.blurY=0,b.quality=1,b.mul_table=[1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1],b.shg_table=[0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9],b.getBounds=function(){var a=.5*Math.pow(this.quality,.6);return new createjs.Rectangle(-this.blurX*a,-this.blurY*a,2*this.blurX*a,2*this.blurY*a)},b.applyFilter=function(a,b,c,d,e,f,g,h){f=f||a,null==g&&(g=b),null==h&&(h=c);try{var i=a.getImageData(b,c,d,e)}catch(j){return!1}var k=this.blurX/2;if(isNaN(k)||0>k)return!1;k|=0;var l=this.blurY/2;if(isNaN(l)||0>l)return!1;if(l|=0,0==k&&0==l)return!1;var m=this.quality;(isNaN(m)||1>m)&&(m=1),m|=0,m>3&&(m=3),1>m&&(m=1);var b,c,n,o,p,q,r,s,t,u,v,w,x,y,z,A=i.data,B=k+k+1,C=l+l+1,D=d-1,E=e-1,F=k+1,G=l+1,H={r:0,b:0,g:0,a:0,next:null},I=H;for(n=1;B>n;n++)I=I.next={r:0,b:0,g:0,a:0,next:null};I.next=H;var J={r:0,b:0,g:0,a:0,next:null},K=J;for(n=1;C>n;n++)K=K.next={r:0,b:0,g:0,a:0,next:null};K.next=J;for(var L=null;m-->0;){r=q=0;var M=this.mul_table[k],N=this.shg_table[k];for(c=e;--c>-1;){for(s=F*(w=A[q]),t=F*(x=A[q+1]),u=F*(y=A[q+2]),v=F*(z=A[q+3]),I=H,n=F;--n>-1;)I.r=w,I.g=x,I.b=y,I.a=z,I=I.next;for(n=1;F>n;n++)o=q+((n>D?D:n)<<2),s+=I.r=A[o],t+=I.g=A[o+1],u+=I.b=A[o+2],v+=I.a=A[o+3],I=I.next;for(L=H,b=0;d>b;b++)A[q++]=s*M>>>N,A[q++]=t*M>>>N,A[q++]=u*M>>>N,A[q++]=v*M>>>N,o=r+((o=b+k+1)b;b++){for(q=b<<2,s=G*(w=A[q]),t=G*(x=A[q+1]),u=G*(y=A[q+2]),v=G*(z=A[q+3]),K=J,n=0;G>n;n++)K.r=w,K.g=x,K.b=y,K.a=z,K=K.next;for(p=d,n=1;l>=n;n++)q=p+b<<2,s+=K.r=A[q],t+=K.g=A[q+1],u+=K.b=A[q+2],v+=K.a=A[q+3],K=K.next,E>n&&(p+=d);if(q=b,L=J,m>0)for(c=0;e>c;c++)o=q<<2,A[o+3]=z=v*M>>>N,z>0?(A[o]=s*M>>>N,A[o+1]=t*M>>>N,A[o+2]=u*M>>>N):A[o]=A[o+1]=A[o+2]=0,o=b+((o=c+G)c;c++)o=q<<2,A[o+3]=z=v*M>>>N,z>0?(z=255/z,A[o]=(s*M>>>N)*z,A[o+1]=(t*M>>>N)*z,A[o+2]=(u*M>>>N)*z):A[o]=A[o+1]=A[o+2]=0,o=b+((o=c+G)n;n+=4)k[n+3]=l[n]||0;return f.putImageData(i,g,h),!0},b.clone=function(){return new a(this.alphaMap)},b.toString=function(){return"[AlphaMapFilter]"},b._prepAlphaMap=function(){if(!this.alphaMap)return!1;if(this.alphaMap==this._alphaMap&&this._mapData)return!0;this._mapData=null;var a,b=this._alphaMap=this.alphaMap,c=b;b instanceof HTMLCanvasElement?a=c.getContext("2d"):(c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"),c.width=b.width,c.height=b.height,a=c.getContext("2d"),a.drawImage(b,0,0));try{var d=a.getImageData(0,0,b.width,b.height)}catch(e){return!1}return this._mapData=d.data,!0},createjs.AlphaMapFilter=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a){this.initialize(a)},b=a.prototype=new createjs.Filter;b.initialize=function(a){this.mask=a},b.mask=null,b.applyFilter=function(a,b,c,d,e,f,g,h){return this.mask?(f=f||a,null==g&&(g=b),null==h&&(h=c),f.save(),f.globalCompositeOperation="destination-in",f.drawImage(this.mask,g,h),f.restore(),!0):!0},b.clone=function(){return new a(this.mask)},b.toString=function(){return"[AlphaMaskFilter]"},createjs.AlphaMaskFilter=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d,e,f,g,h){this.initialize(a,b,c,d,e,f,g,h)},b=a.prototype=new createjs.Filter;b.redMultiplier=1,b.greenMultiplier=1,b.blueMultiplier=1,b.alphaMultiplier=1,b.redOffset=0,b.greenOffset=0,b.blueOffset=0,b.alphaOffset=0,b.initialize=function(a,b,c,d,e,f,g,h){this.redMultiplier=null!=a?a:1,this.greenMultiplier=null!=b?b:1,this.blueMultiplier=null!=c?c:1,this.alphaMultiplier=null!=d?d:1,this.redOffset=e||0,this.greenOffset=f||0,this.blueOffset=g||0,this.alphaOffset=h||0},b.applyFilter=function(a,b,c,d,e,f,g,h){f=f||a,null==g&&(g=b),null==h&&(h=c);try{var i=a.getImageData(b,c,d,e)}catch(j){return!1}for(var k=i.data,l=k.length,m=0;l>m;m+=4)k[m]=k[m]*this.redMultiplier+this.redOffset,k[m+1]=k[m+1]*this.greenMultiplier+this.greenOffset,k[m+2]=k[m+2]*this.blueMultiplier+this.blueOffset,k[m+3]=k[m+3]*this.alphaMultiplier+this.alphaOffset;return f.putImageData(i,g,h),!0},b.toString=function(){return"[ColorFilter]"},b.clone=function(){return new a(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset)},createjs.ColorFilter=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c,d){this.initialize(a,b,c,d)},b=a.prototype;a.DELTA_INDEX=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],a.IDENTITY_MATRIX=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],a.LENGTH=a.IDENTITY_MATRIX.length,b.initialize=function(a,b,c,d){return this.reset(),this.adjustColor(a,b,c,d),this},b.reset=function(){return this.copyMatrix(a.IDENTITY_MATRIX)},b.adjustColor=function(a,b,c,d){return this.adjustHue(d),this.adjustContrast(b),this.adjustBrightness(a),this.adjustSaturation(c)},b.adjustBrightness=function(a){return 0==a||isNaN(a)?this:(a=this._cleanValue(a,255),this._multiplyMatrix([1,0,0,0,a,0,1,0,0,a,0,0,1,0,a,0,0,0,1,0,0,0,0,0,1]),this)},b.adjustContrast=function(b){if(0==b||isNaN(b))return this;b=this._cleanValue(b,100);var c;return 0>b?c=127+127*(b/100):(c=b%1,c=0==c?a.DELTA_INDEX[b]:a.DELTA_INDEX[b<<0]*(1-c)+a.DELTA_INDEX[(b<<0)+1]*c,c=127*c+127),this._multiplyMatrix([c/127,0,0,0,.5*(127-c),0,c/127,0,0,.5*(127-c),0,0,c/127,0,.5*(127-c),0,0,0,1,0,0,0,0,0,1]),this},b.adjustSaturation=function(a){if(0==a||isNaN(a))return this;a=this._cleanValue(a,100);var b=1+(a>0?3*a/100:a/100),c=.3086,d=.6094,e=.082;return this._multiplyMatrix([c*(1-b)+b,d*(1-b),e*(1-b),0,0,c*(1-b),d*(1-b)+b,e*(1-b),0,0,c*(1-b),d*(1-b),e*(1-b)+b,0,0,0,0,0,1,0,0,0,0,0,1]),this},b.adjustHue=function(a){if(0==a||isNaN(a))return this;a=this._cleanValue(a,180)/180*Math.PI;var b=Math.cos(a),c=Math.sin(a),d=.213,e=.715,f=.072;return this._multiplyMatrix([d+b*(1-d)+c*-d,e+b*-e+c*-e,f+b*-f+c*(1-f),0,0,d+b*-d+.143*c,e+b*(1-e)+.14*c,f+b*-f+c*-.283,0,0,d+b*-d+c*-(1-d),e+b*-e+c*e,f+b*(1-f)+c*f,0,0,0,0,0,1,0,0,0,0,0,1]),this},b.concat=function(b){return b=this._fixMatrix(b),b.length!=a.LENGTH?this:(this._multiplyMatrix(b),this)},b.clone=function(){return(new a).copyMatrix(this)},b.toArray=function(){for(var b=[],c=0,d=a.LENGTH;d>c;c++)b[c]=this[c];return b},b.copyMatrix=function(b){for(var c=a.LENGTH,d=0;c>d;d++)this[d]=b[d];return this},b.toString=function(){return"[ColorMatrix]"},b._multiplyMatrix=function(a){for(var b=[],c=0;5>c;c++){for(var d=0;5>d;d++)b[d]=this[d+5*c];for(var d=0;5>d;d++){for(var e=0,f=0;5>f;f++)e+=a[d+5*f]*b[f];this[d+5*c]=e}}},b._cleanValue=function(a,b){return Math.min(b,Math.max(-b,a))},b._fixMatrix=function(b){return b instanceof a&&(b=b.toArray()),b.lengtha.LENGTH&&(b=b.slice(0,a.LENGTH)),b},createjs.ColorMatrix=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a){this.initialize(a)},b=a.prototype=new createjs.Filter;b.matrix=null,b.initialize=function(a){this.matrix=a},b.applyFilter=function(a,b,c,d,e,f,g,h){f=f||a,null==g&&(g=b),null==h&&(h=c);try{var i=a.getImageData(b,c,d,e)}catch(j){return!1}for(var k,l,m,n,o=i.data,p=o.length,q=this.matrix,r=q[0],s=q[1],t=q[2],u=q[3],v=q[4],w=q[5],x=q[6],y=q[7],z=q[8],A=q[9],B=q[10],C=q[11],D=q[12],E=q[13],F=q[14],G=q[15],H=q[16],I=q[17],J=q[18],K=q[19],L=0;p>L;L+=4)k=o[L],l=o[L+1],m=o[L+2],n=o[L+3],o[L]=k*r+l*s+m*t+n*u+v,o[L+1]=k*w+l*x+m*y+n*z+A,o[L+2]=k*B+l*C+m*D+n*E+F,o[L+3]=k*G+l*H+m*I+n*J+K;return f.putImageData(i,g,h),!0},b.toString=function(){return"[ColorMatrixFilter]"},b.clone=function(){return new a(this.matrix)},createjs.ColorMatrixFilter=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){throw"Touch cannot be instantiated"};a.isSupported=function(){return"ontouchstart"in window||window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>0||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>0},a.enable=function(b,c,d){return b&&b.canvas&&a.isSupported()?(b.__touch={pointers:{},multitouch:!c,preventDefault:!d,count:0},"ontouchstart"in window?a._IOS_enable(b):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&a._IE_enable(b),!0):!1},a.disable=function(b){b&&("ontouchstart"in window?a._IOS_disable(b):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&a._IE_disable(b))},a._IOS_enable=function(b){var c=b.canvas,d=b.__touch.f=function(c){a._IOS_handleEvent(b,c)};c.addEventListener("touchstart",d,!1),c.addEventListener("touchmove",d,!1),c.addEventListener("touchend",d,!1),c.addEventListener("touchcancel",d,!1)},a._IOS_disable=function(a){var b=a.canvas;if(b){var c=a.__touch.f;b.removeEventListener("touchstart",c,!1),b.removeEventListener("touchmove",c,!1),b.removeEventListener("touchend",c,!1),b.removeEventListener("touchcancel",c,!1)}},a._IOS_handleEvent=function(a,b){if(a){a.__touch.preventDefault&&b.preventDefault&&b.preventDefault();for(var c=b.changedTouches,d=b.type,e=0,f=c.length;f>e;e++){var g=c[e],h=g.identifier;g.target==a.canvas&&("touchstart"==d?this._handleStart(a,h,b,g.pageX,g.pageY):"touchmove"==d?this._handleMove(a,h,b,g.pageX,g.pageY):("touchend"==d||"touchcancel"==d)&&this._handleEnd(a,h,b))}}},a._IE_enable=function(b){var c=b.canvas,d=b.__touch.f=function(c){a._IE_handleEvent(b,c)};void 0===window.navigator.pointerEnabled?(c.addEventListener("MSPointerDown",d,!1),window.addEventListener("MSPointerMove",d,!1),window.addEventListener("MSPointerUp",d,!1),window.addEventListener("MSPointerCancel",d,!1),b.__touch.preventDefault&&(c.style.msTouchAction="none")):(c.addEventListener("pointerdown",d,!1),window.addEventListener("pointermove",d,!1),window.addEventListener("pointerup",d,!1),window.addEventListener("pointercancel",d,!1),b.__touch.preventDefault&&(c.style.touchAction="none")),b.__touch.activeIDs={}},a._IE_disable=function(a){var b=a.__touch.f;void 0===window.navigator.pointerEnabled?(window.removeEventListener("MSPointerMove",b,!1),window.removeEventListener("MSPointerUp",b,!1),window.removeEventListener("MSPointerCancel",b,!1),a.canvas&&a.canvas.removeEventListener("MSPointerDown",b,!1)):(window.removeEventListener("pointermove",b,!1),window.removeEventListener("pointerup",b,!1),window.removeEventListener("pointercancel",b,!1),a.canvas&&a.canvas.removeEventListener("pointerdown",b,!1))},a._IE_handleEvent=function(a,b){if(a){a.__touch.preventDefault&&b.preventDefault&&b.preventDefault();var c=b.type,d=b.pointerId,e=a.__touch.activeIDs;if("MSPointerDown"==c||"pointerdown"==c){if(b.srcElement!=a.canvas)return;e[d]=!0,this._handleStart(a,d,b,b.pageX,b.pageY)}else e[d]&&("MSPointerMove"==c||"pointermove"==c?this._handleMove(a,d,b,b.pageX,b.pageY):("MSPointerUp"==c||"MSPointerCancel"==c||"pointerup"==c||"pointercancel"==c)&&(delete e[d],this._handleEnd(a,d,b)))}},a._handleStart=function(a,b,c,d,e){var f=a.__touch;if(f.multitouch||!f.count){var g=f.pointers;g[b]||(g[b]=!0,f.count++,a._handlePointerDown(b,c,d,e))}},a._handleMove=function(a,b,c,d,e){a.__touch.pointers[b]&&a._handlePointerMove(b,c,d,e)},a._handleEnd=function(a,b,c){var d=a.__touch,e=d.pointers;e[b]&&(d.count--,a._handlePointerUp(b,c,!0),delete e[b])},createjs.Touch=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=createjs.EaselJS=createjs.EaselJS||{};a.version="0.7.1",a.buildDate="Thu, 12 Dec 2013 23:33:39 GMT"}(),function(){var a=this.createjs=this.createjs||{},a=a.PreloadJS=a.PreloadJS||{};a.version="0.3.1",a.buildDate="Thu, 09 May 2013 22:04:32 GMT"}(),this.createjs=this.createjs||{},function(){var a=function(){this.initialize()},b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.removeEventListener=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent},b._listeners=null,b.initialize=function(){},b.addEventListener=function(a,b){var c=this._listeners;c?this.removeEventListener(a,b):c=this._listeners={};var d=c[a];return d||(d=c[a]=[]),d.push(b),b},b.removeEventListener=function(a,b){var c=this._listeners;if(c){var d=c[a];if(d)for(var e=0,f=d.length;f>e;e++)if(d[e]==b){1==f?delete c[a]:d.splice(e,1);break}}},b.removeAllEventListeners=function(a){a?this._listeners&&delete this._listeners[a]:this._listeners=null},b.dispatchEvent=function(a,b){var c=!1,d=this._listeners;if(a&&d){if("string"==typeof a&&(a={type:a}),d=d[a.type],!d)return c;a.target=b||this;for(var d=d.slice(),e=0,f=d.length;f>e;e++)var g=d[e],c=g.handleEvent?c||g.handleEvent(a):c||g(a)}return!!c},b.hasEventListener=function(a){var b=this._listeners;return!(!b||!b[a])},b.toString=function(){return"[EventDispatcher]"},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){var a=function(){this.init()};a.prototype={};var b=a.prototype;a.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/,b.loaded=!1,b.canceled=!1,b.progress=0,b._item=null,b._basePath=null,b.onProgress=null,b.onLoadStart=null,b.onComplete=null,b.onError=null,b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b.getItem=function(){return this._item},b.init=function(){},b.load=function(){},b.close=function(){},b._sendLoadStart=function(){this._isCanceled()||(this.onLoadStart&&this.onLoadStart({target:this}),this.dispatchEvent("loadStart"),this.dispatchEvent("loadstart"))},b._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b={loaded:this.progress,total:1}):(b=a,this.progress=a.loaded/a.total,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),b.target=this,b.type="progress",b.progress=this.progress,this.onProgress&&this.onProgress(b),this.dispatchEvent(b)}},b._sendComplete=function(){this._isCanceled()||(this.onComplete&&this.onComplete({target:this}),this.dispatchEvent("complete"))},b._sendError=function(a){this._isCanceled()||(null==a&&(a={}),a.target=this,a.type="error",this.onError&&this.onError(a),this.dispatchEvent(a))},b._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},b._parseURI=function(b){return b?b.match(a.FILE_PATTERN):null},b._formatQueryString=function(a,b){if(null==a)throw Error("You must specify data.");var c,d=[];for(c in a)d.push(c+"="+escape(a[c]));return b&&(d=d.concat(b)),d.join("&")},b.buildPath=function(a,b,c){if(null!=b){var d=this._parseURI(a);(null==d[1]||""==d[1])&&(a=b+a)}if(null==c)return a;if(b=[],d=a.indexOf("?"),-1!=d)var e=a.slice(d+1),b=b.concat(e.split("&"));return-1!=d?a.slice(0,d)+"?"+this._formatQueryString(c,b):a+"?"+this._formatQueryString(c,b)},b.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=a}(),this.createjs=this.createjs||{},function(){var a=function(a,b){this.init(a,b)},b=a.prototype=new createjs.AbstractLoader;a.LOAD_TIMEOUT=8e3,a.BINARY="binary",a.CSS="css",a.IMAGE="image",a.JAVASCRIPT="javascript",a.JSON="json",a.JSONP="jsonp",a.SOUND="sound",a.SVG="svg",a.TEXT="text",a.XML="xml",a.POST="POST",a.GET="GET",b.useXHR=!0,b.stopOnError=!1,b.maintainScriptOrder=!0,b.next=null,b.onFileLoad=null,b.onFileProgress=null,b._typeCallbacks=null,b._extensionCallbacks=null,b._loadStartWasDispatched=!1,b._maxConnections=1,b._currentlyLoadingScript=null,b._currentLoads=null,b._loadQueue=null,b._loadQueueBackup=null,b._loadItemsById=null,b._loadItemsBySrc=null,b._loadedResults=null,b._loadedRawResults=null,b._numItems=0,b._numItemsLoaded=0,b._scriptOrder=null,b._loadedScripts=null,b.init=function(a,b){this._numItems=this._numItemsLoaded=0,this._loadStartWasDispatched=this._paused=!1,this._currentLoads=[],this._loadQueue=[],this._loadQueueBackup=[],this._scriptOrder=[],this._loadedScripts=[],this._loadItemsById={},this._loadItemsBySrc={},this._loadedResults={},this._loadedRawResults={},this._typeCallbacks={},this._extensionCallbacks={},this._basePath=b,this.setUseXHR(a)},b.setUseXHR=function(a){return this.useXHR=0!=a&&null!=window.XMLHttpRequest},b.removeAll=function(){this.remove()},b.remove=function(a){var b=null;if(!a||a instanceof Array?a&&(b=a):b=[a],a=!1,b){for(;b.length;){for(var c=b.pop(),d=this.getResult(c),e=this._loadQueue.length-1;e>=0;e--)if(f=this._loadQueue[e].getItem(),f.id==c||f.src==c){this._loadQueue.splice(e,1)[0].cancel();break}for(e=this._loadQueueBackup.length-1;e>=0;e--)if(f=this._loadQueueBackup[e].getItem(),f.id==c||f.src==c){this._loadQueueBackup.splice(e,1)[0].cancel();break}if(d)delete this._loadItemsById[d.id],delete this._loadItemsBySrc[d.src],this._disposeItem(d);else for(var e=this._currentLoads.length-1;e>=0;e--){var f=this._currentLoads[e].getItem();if(f.id==c||f.src==c){this._currentLoads.splice(e,1)[0].cancel(),a=!0;break}}}a&&this._loadNext()}else{this.close();for(c in this._loadItemsById)this._disposeItem(this._loadItemsById[c]);this.init(this.useXHR)}},b.reset=function(){this.close();for(var a in this._loadItemsById)this._disposeItem(this._loadItemsById[a]);for(a=[],i=0,l=this._loadQueueBackup.length;l>i;i++)a.push(this._loadQueueBackup[i].getItem());this.loadManifest(a,!1)},a.isBinary=function(a){switch(a){case createjs.LoadQueue.IMAGE:case createjs.LoadQueue.BINARY:return!0;default:return!1}},b.installPlugin=function(a){if(null!=a&&null!=a.getPreloadHandlers){if(a=a.getPreloadHandlers(),null!=a.types)for(var b=0,c=a.types.length;c>b;b++)this._typeCallbacks[a.types[b]]=a.callback;if(null!=a.extensions)for(b=0,c=a.extensions.length;c>b;b++)this._extensionCallbacks[a.extensions[b]]=a.callback}},b.setMaxConnections=function(a){this._maxConnections=a,!this._paused&&this._loadQueue.length>0&&this._loadNext()},b.loadFile=function(a,b,c){null==a?this._sendError({text:"PRELOAD_NO_FILE"}):(this._addItem(a,c),this.setPaused(b!==!1?!1:!0))},b.loadManifest=function(a,b,c){var d=null;if(a instanceof Array){if(0==a.length)return void this._sendError({text:"PRELOAD_MANIFEST_EMPTY"});d=a}else{if(null==a)return void this._sendError({text:"PRELOAD_MANIFEST_NULL"});d=[a]}for(var a=0,e=d.length;e>a;a++)this._addItem(d[a],c);this.setPaused(b!==!1?!1:!0)},b.load=function(){this.setPaused(!1)},b.getItem=function(a){return this._loadItemsById[a]||this._loadItemsBySrc[a]},b.getResult=function(a,b){var c=this._loadItemsById[a]||this._loadItemsBySrc[a];return null==c?null:(c=c.id,b&&this._loadedRawResults[c]?this._loadedRawResults[c]:this._loadedResults[c])},b.setPaused=function(a){(this._paused=a)||this._loadNext()},b.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._scriptOrder.length=0,this._loadedScripts.length=0,this.loadStartWasDispatched=!1},b._addItem=function(a,b){var c=this._createLoadItem(a);if(null!=c){var d=this._createLoader(c,b);null!=d&&(this._loadQueue.push(d),this._loadQueueBackup.push(d),this._numItems++,this._updateProgress(),this.maintainScriptOrder&&c.type==createjs.LoadQueue.JAVASCRIPT&&d instanceof createjs.XHRLoader&&(this._scriptOrder.push(c),this._loadedScripts.push(null)))}},b._createLoadItem=function(a){var b=null;switch(typeof a){case"string":b={src:a};break;case"object":b=window.HTMLAudioElement&&a instanceof HTMLAudioElement?{tag:a,src:b.tag.src,type:createjs.LoadQueue.SOUND}:a}if(a=this._parseURI(b.src),null!=a&&(b.ext=a[5]),null==b.type&&(b.type=this._getTypeByExtension(b.ext)),b.type==createjs.LoadQueue.JSON&&null!=b.callback&&(b.type=createjs.LoadQueue.JSONP),b.type==createjs.LoadQueue.JSONP&&null==b.callback)throw Error("callback is required for loading JSONP requests.");if(null==b.tag&&(b.tag=this._createTag(b.type)),(null==b.id||""==b.id)&&(b.id=b.src),a=this._typeCallbacks[b.type]||this._extensionCallbacks[b.ext]){if(a=a(b.src,b.type,b.id,b.data),a===!1)return null;a!==!0&&(null!=a.src&&(b.src=a.src),null!=a.id&&(b.id=a.id),null!=a.tag&&a.tag.load instanceof Function&&(b.tag=a.tag),null!=a.completeHandler&&(b.completeHandler=a.completeHandler)),a.type&&(b.type=a.type),a=this._parseURI(b.src),null!=a&&null!=a[5]&&(b.ext=a[5].toLowerCase())}return this._loadItemsById[b.id]=b,this._loadItemsBySrc[b.src]=b},b._createLoader=function(a,b){var c=this.useXHR;switch(a.type){case createjs.LoadQueue.JSON:case createjs.LoadQueue.XML:case createjs.LoadQueue.TEXT:c=!0;break;case createjs.LoadQueue.SOUND:case createjs.LoadQueue.JSONP:c=!1}return null==b&&(b=this._basePath),c?new createjs.XHRLoader(a,b):new createjs.TagLoader(a,b)},b._loadNext=function(){if(!this._paused){this._loadStartWasDispatched||(this._sendLoadStart(),this._loadStartWasDispatched=!0),this._numItems==this._numItemsLoaded&&(this.loaded=!0,this._sendComplete(),this.next&&this.next.load&&this.next.load());for(var a=0,b=this._loadQueue.length;b>a&&!(this._currentLoads.length>=this._maxConnections);a++){var c=this._loadQueue[a];if(this.maintainScriptOrder&&c instanceof createjs.TagLoader&&c.getItem().type==createjs.LoadQueue.JAVASCRIPT){if(this._currentlyLoadingScript)continue;this._currentlyLoadingScript=!0}this._loadQueue.splice(a,1),a--,b--,this._loadItem(c)}}},b._loadItem=function(a){a.addEventListener("progress",createjs.proxy(this._handleProgress,this)),a.addEventListener("complete",createjs.proxy(this._handleFileComplete,this)),a.addEventListener("error",createjs.proxy(this._handleFileError,this)),this._currentLoads.push(a),this._sendFileStart(a.getItem()),a.load()},b._handleFileError=function(a){var b=a.target;this._numItemsLoaded++,this._updateProgress(),a={item:b.getItem()},this._sendError(a),this.stopOnError||(this._removeLoadItem(b),this._loadNext())},b._handleFileComplete=function(a){var a=a.target,b=a.getItem();if(this._loadedResults[b.id]=a.getResult(),a instanceof createjs.XHRLoader&&(this._loadedRawResults[b.id]=a.getResult(!0)),this._removeLoadItem(a),this.maintainScriptOrder&&b.type==createjs.LoadQueue.JAVASCRIPT){if(!(a instanceof createjs.TagLoader))return this._loadedScripts[this._scriptOrder.indexOf(b)]=b,void this._checkScriptLoadOrder(a);this._currentlyLoadingScript=!1}this._processFinishedLoad(b,a)},b._processFinishedLoad=function(a,b){this._numItemsLoaded++,this._updateProgress(),this._sendFileComplete(a,b),this._loadNext()},b._checkScriptLoadOrder=function(){for(var a=this._loadedScripts.length,b=0;a>b;b++){var c=this._loadedScripts[b];if(null===c)break;c!==!0&&(this._processFinishedLoad(c),this._loadedScripts[b]=!0,b--,a--)}},b._removeLoadItem=function(a){for(var b=this._currentLoads.length,c=0;b>c;c++)if(this._currentLoads[c]==a){this._currentLoads.splice(c,1);break}},b._handleProgress=function(a){a=a.target,this._sendFileProgress(a.getItem(),a.progress),this._updateProgress()},b._updateProgress=function(){var a=this._numItemsLoaded/this._numItems,b=this._numItems-this._numItemsLoaded;if(b>0){for(var c=0,d=0,e=this._currentLoads.length;e>d;d++)c+=this._currentLoads[d].progress;a+=c/b*(b/this._numItems)}this._sendProgress(a)},b._disposeItem=function(a){delete this._loadedResults[a.id],delete this._loadedRawResults[a.id],delete this._loadItemsById[a.id],delete this._loadItemsBySrc[a.src]},b._createTag=function(a){var b=null;switch(a){case createjs.LoadQueue.IMAGE:return document.createElement("img");case createjs.LoadQueue.SOUND:return b=document.createElement("audio"),b.autoplay=!1,b;case createjs.LoadQueue.JSONP:case createjs.LoadQueue.JAVASCRIPT:return b=document.createElement("script"),b.type="text/javascript",b;case createjs.LoadQueue.CSS:return b=document.createElement(this.useXHR?"style":"link"),b.rel="stylesheet",b.type="text/css",b;case createjs.LoadQueue.SVG:return this.useXHR?b=document.createElement("svg"):(b=document.createElement("object"),b.type="image/svg+xml"),b}return null},b._getTypeByExtension=function(a){switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.LoadQueue.IMAGE;case"ogg":case"mp3":case"wav":return createjs.LoadQueue.SOUND;case"json":return createjs.LoadQueue.JSON;case"xml":return createjs.LoadQueue.XML;case"css":return createjs.LoadQueue.CSS;case"js":return createjs.LoadQueue.JAVASCRIPT;case"svg":return createjs.LoadQueue.SVG;default:return createjs.LoadQueue.TEXT}},b._sendFileProgress=function(a,b){if(this._isCanceled())this._cleanUp();else{var c={target:this,type:"fileprogress",progress:b,loaded:b,total:1,item:a};this.onFileProgress&&this.onFileProgress(c),this.dispatchEvent(c)}},b._sendFileComplete=function(a,b){if(!this._isCanceled()){var c={target:this,type:"fileload",loader:b,item:a,result:this._loadedResults[a.id],rawResult:this._loadedRawResults[a.id]};a.completeHandler&&a.completeHandler(c),this.onFileLoad&&this.onFileLoad(c),this.dispatchEvent(c)}},b._sendFileStart=function(a){this.dispatchEvent({target:this,type:"filestart",item:a})},b.toString=function(){return"[PreloadJS LoadQueue]"},a.proxy=function(a,b){return function(){return a.apply(b,arguments)}},createjs.LoadQueue=a,createjs.proxy||(createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}});var c=function(){};c.init=function(){var a=navigator.userAgent;c.isFirefox=a.indexOf("Firefox")>-1,c.isOpera=null!=window.opera,c.isChrome=a.indexOf("Chrome")>-1,c.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1},c.init(),createjs.LoadQueue.BrowserDetect=c,Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&1/0!=d&&d!=-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(d=d>=0?d:Math.max(c-Math.abs(d),0);c>d;d++)if(d in b&&b[d]===a)return d;return-1})}(),this.createjs=this.createjs||{},function(){var a=function(a,b){this.init(a,b)},b=a.prototype=new createjs.AbstractLoader;b._loadTimeout=null,b._tagCompleteProxy=null,b._isAudio=!1,b._tag=null,b._jsonResult=null,b.init=function(a,b){this._item=a,this._basePath=b,this._tag=a.tag,this._isAudio=window.HTMLAudioElement&&a.tag instanceof HTMLAudioElement,this._tagCompleteProxy=createjs.proxy(this._handleLoad,this) },b.getResult=function(){return this._item.type==createjs.LoadQueue.JSONP?this._jsonResult:this._tag},b.cancel=function(){this.canceled=!0,this._clean(),this.getItem()},b.load=function(){var a=this._item,b=this._tag;clearTimeout(this._loadTimeout),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),createjs.LoadQueue.LOAD_TIMEOUT),this._isAudio&&(b.src=null,b.preload="auto"),b.onerror=createjs.proxy(this._handleError,this),this._isAudio?(b.onstalled=createjs.proxy(this._handleStalled,this),b.addEventListener("canplaythrough",this._tagCompleteProxy,!1)):(b.onload=createjs.proxy(this._handleLoad,this),b.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this));var c=this.buildPath(a.src,this._basePath,a.values);switch(a.type){case createjs.LoadQueue.CSS:b.href=c;break;case createjs.LoadQueue.SVG:b.data=c;break;default:b.src=c}if(a.type==createjs.LoadQueue.JSONP){if(null==a.callback)throw Error("callback is required for loading JSONP requests.");if(null!=window[a.callback])throw Error('JSONP callback "'+a.callback+'" already exists on window. You need to specify a different callback. Or re-name the current one.');window[a.callback]=createjs.proxy(this._handleJSONPLoad,this)}(a.type==createjs.LoadQueue.SVG||a.type==createjs.LoadQueue.JSONP||a.type==createjs.LoadQueue.JSON||a.type==createjs.LoadQueue.JAVASCRIPT||a.type==createjs.LoadQueue.CSS)&&(this._startTagVisibility=b.style.visibility,b.style.visibility="hidden",(document.body||document.getElementsByTagName("body")[0]).appendChild(b)),null!=b.load&&b.load()},b._handleJSONPLoad=function(a){this._jsonResult=a},b._handleTimeout=function(){this._clean(),this._sendError({reason:"PRELOAD_TIMEOUT"})},b._handleStalled=function(){},b._handleError=function(){this._clean(),this._sendError()},b._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this.getItem().tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleLoad()},b._handleLoad=function(){if(!this._isCanceled()){var a=this.getItem(),b=a.tag;if(!(this.loaded||this.isAudio&&4!==b.readyState)){switch(this.loaded=!0,a.type){case createjs.LoadQueue.SVG:case createjs.LoadQueue.JSONP:b.style.visibility=this._startTagVisibility,(document.body||document.getElementsByTagName("body")[0]).removeChild(b)}this._clean(),this._sendComplete()}}},b._clean=function(){clearTimeout(this._loadTimeout);var a=this.getItem().tag;a.onload=null,a.removeEventListener&&a.removeEventListener("canplaythrough",this._tagCompleteProxy,!1),a.onstalled=null,a.onprogress=null,a.onerror=null,a.parentNode&&a.parentNode.removeChild(a),a=this.getItem(),a.type==createjs.LoadQueue.JSONP&&(window[a.callback]=null)},b.toString=function(){return"[PreloadJS TagLoader]"},createjs.TagLoader=a}(),this.createjs=this.createjs||{},function(){var a=function(a,b){this.init(a,b)},b=a.prototype=new createjs.AbstractLoader;b._request=null,b._loadTimeout=null,b._xhrLevel=1,b._response=null,b._rawResponse=null,b.init=function(a,b){this._item=a,this._basePath=b,this._createXHR(a)},b.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},b.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},b.load=function(){if(null==this._request)this._handleError();else{this._request.onloadstart=createjs.proxy(this._handleLoadStart,this),this._request.onprogress=createjs.proxy(this._handleProgress,this),this._request.onabort=createjs.proxy(this._handleAbort,this),this._request.onerror=createjs.proxy(this._handleError,this),this._request.ontimeout=createjs.proxy(this._handleTimeout,this),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),createjs.LoadQueue.LOAD_TIMEOUT)),this._request.onload=createjs.proxy(this._handleLoad,this),this._request.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this);try{this._item.values&&this._item.method!=createjs.LoadQueue.GET?this._item.method==createjs.LoadQueue.POST&&this._request.send(this._formatQueryString(this._item.values)):this._request.send()}catch(a){this._sendError({source:a})}}},b.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},b.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},b._handleProgress=function(a){a.loaded>0&&0==a.total||this._sendProgress({loaded:a.loaded,total:a.total})},b._handleLoadStart=function(){clearTimeout(this._loadTimeout),this._sendLoadStart()},b._handleAbort=function(){this._clean(),this._sendError()},b._handleError=function(){this._clean(),this._sendError()},b._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},b._handleLoad=function(){this.loaded||(this.loaded=!0,this._checkError()?(this._response=this._getResponse(),this._clean(),this._generateTag()&&this._sendComplete()):this._handleError())},b._handleTimeout=function(){this._clean(),this._sendError({reason:"PRELOAD_TIMEOUT"})},b._checkError=function(){switch(parseInt(this._request.status)){case 404:case 0:return!1}return!0},b._getResponse=function(){if(null!=this._response)return this._response;if(null!=this._request.response)return this._request.response;try{if(null!=this._request.responseText)return this._request.responseText}catch(a){}try{if(null!=this._request.responseXML)return this._request.responseXML}catch(b){}return null},b._createXHR=function(a){var b=document.createElement("a");b.href=this.buildPath(a.src,this._basePath);var c=document.createElement("a");if(c.href=location.href,b=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname),c=null,b&&window.XDomainRequest)c=new XDomainRequest;else if(window.XMLHttpRequest)c=new XMLHttpRequest;else try{c=new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(d){try{c=new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){return!1}}}a.type==createjs.LoadQueue.TEXT&&c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),this._xhrLevel="string"==typeof c.responseType?2:1;var g=null,g=a.method==createjs.LoadQueue.GET?this.buildPath(a.src,this._basePath,a.values):this.buildPath(a.src,this._basePath);return c.open(a.method||createjs.LoadQueue.GET,g,!0),b&&c instanceof XMLHttpRequest&&1==this._xhrLevel&&c.setRequestHeader("Origin",location.origin),a.values&&a.method==createjs.LoadQueue.POST&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),createjs.LoadQueue.isBinary(a.type)&&(c.responseType="arraybuffer"),this._request=c,!0},b._clean=function(){clearTimeout(this._loadTimeout);var a=this._request;a.onloadstart=null,a.onprogress=null,a.onabort=null,a.onerror=null,a.onload=null,a.ontimeout=null,a.onloadend=null,a.onreadystatechange=null},b._generateTag=function(){var a=this._item.tag;switch(this._item.type){case createjs.LoadQueue.IMAGE:return a.onload=createjs.proxy(this._handleTagReady,this),a.src=this.buildPath(this._item.src,this._basePath,this._item.values),this._rawResponse=this._response,this._response=a,!1;case createjs.LoadQueue.JAVASCRIPT:a=document.createElement("script"),this._rawResponse=a.text=this._response,this._response=a;break;case createjs.LoadQueue.CSS:if(document.getElementsByTagName("head")[0].appendChild(a),a.styleSheet)a.styleSheet.cssText=this._response;else{var b=document.createTextNode(this._response);a.appendChild(b)}this._rawResponse=this._response,this._response=a;break;case createjs.LoadQueue.XML:this._response=b=this._parseXML(this._response,"text/xml");break;case createjs.LoadQueue.SVG:b=this._parseXML(this._response,"image/svg+xml"),this._rawResponse=this._response,null!=b.documentElement?(a.appendChild(b.documentElement),this._response=a):this._response=b;break;case createjs.LoadQueue.JSON:a={};try{a=JSON.parse(this._response)}catch(c){a=c}this._rawResponse=this._response,this._response=a}return!0},b._parseXML=function(a,b){var c=null;return window.DOMParser?c=(new DOMParser).parseFromString(a,b):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a)),c},b._handleTagReady=function(){this._sendComplete()},b.toString=function(){return"[PreloadJS XHRLoader]"},createjs.XHRLoader=a}(),"object"!=typeof JSON&&(JSON={}),function(){function c(a){return 10>a?"0"+a:a}function a(a){return e.lastIndex=0,e.test(a)?'"'+a.replace(e,function(a){var b=o[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function d(b,c){var e,g,i,k,l,m=j,n=c[b];switch(n&&"object"==typeof n&&"function"==typeof n.toJSON&&(n=n.toJSON(b)),"function"==typeof h&&(n=h.call(c,b,n)),typeof n){case"string":return a(n);case"number":return isFinite(n)?String(n):"null";case"boolean":case"null":return String(n);case"object":if(!n)return"null";if(j+=f,l=[],"[object Array]"===Object.prototype.toString.apply(n)){for(k=n.length,e=0;k>e;e+=1)l[e]=d(e,n)||"null";return i=0===l.length?"[]":j?"[\n"+j+l.join(",\n"+j)+"\n"+m+"]":"["+l.join(",")+"]",j=m,i}if(h&&"object"==typeof h)for(k=h.length,e=0;k>e;e+=1)"string"==typeof h[e]&&(g=h[e],(i=d(g,n))&&l.push(a(g)+(j?": ":":")+i));else for(g in n)Object.prototype.hasOwnProperty.call(n,g)&&(i=d(g,n))&&l.push(a(g)+(j?": ":":")+i);return i=0===l.length?"{}":j?"{\n"+j+l.join(",\n"+j)+"\n"+m+"}":"{"+l.join(",")+"}",j=m,i}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+c(this.getUTCMonth()+1)+"-"+c(this.getUTCDate())+"T"+c(this.getUTCHours())+":"+c(this.getUTCMinutes())+":"+c(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,j,f,o={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var e;if(f=j="","number"==typeof c)for(e=0;c>e;e+=1)f+=" ";else"string"==typeof c&&(f=c);if((h=b)&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw Error("JSON.stringify");return d("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(a,c){function d(a,b){var e,f,g=a[b];if(g&&"object"==typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=d(g,e),void 0!==f?g[e]=f:delete g[e]);return c.call(a,b,g)}var e,a=String(a);if(b.lastIndex=0,b.test(a)&&(a=a.replace(b,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"==typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse")})}(),this.createjs=this.createjs||{},function(){var a=createjs.SoundJS=createjs.SoundJS||{};a.version="0.5.2",a.buildDate="Thu, 12 Dec 2013 23:33:37 GMT"}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){},b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.on=b.on,a.removeEventListener=a.off=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent,a._dispatchEvent=b._dispatchEvent,a.willTrigger=b.willTrigger},b._listeners=null,b._captureListeners=null,b.initialize=function(){},b.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},b.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},b.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},b.off=b.removeEventListener,b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},b.dispatchEvent=function(a,b){if("string"==typeof a){var c=this._listeners;if(!c||!c[a])return!1;a=new createjs.Event(a)}if(a.target=b||this,a.bubbles&&this.parent){for(var d=this,e=[d];d.parent;)e.push(d=d.parent);var f,g=e.length;for(f=g-1;f>=0&&!a.propagationStopped;f--)e[f]._dispatchEvent(a,1+(0==f));for(f=1;g>f&&!a.propagationStopped;f++)e[f]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return a.defaultPrevented},b.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},b.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},b.toString=function(){return"[EventDispatcher]"},b._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;a.currentTarget=this,a.eventPhase=b,a.removed=!1,e=e.slice();for(var f=0;c>f&&!a.immediatePropagationStopped;f++){var g=e[f];g.handleEvent?g.handleEvent(a):g(a),a.removed&&(this.off(a.type,g,1==b),a.removed=!1)}}},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype;b.type=null,b.target=null,b.currentTarget=null,b.eventPhase=0,b.bubbles=!1,b.cancelable=!1,b.timeStamp=0,b.defaultPrevented=!1,b.propagationStopped=!1,b.immediatePropagationStopped=!1,b.removed=!1,b.initialize=function(a,b,c){this.type=a,this.bubbles=b,this.cancelable=c,this.timeStamp=(new Date).getTime()},b.preventDefault=function(){this.defaultPrevented=!0},b.stopPropagation=function(){this.propagationStopped=!0},b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},b.remove=function(){this.removed=!0},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)},b.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=a}(),this.createjs=this.createjs||{},function(){"use strict";createjs.indexOf=function(a,b){for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1}}(),this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"Sound cannot be instantiated"}function b(a,b){this.init(a,b)}function c(){this.isDefault=!0,this.addEventListener=this.removeEventListener=this.removeAllEventListeners=this.dispatchEvent=this.hasEventListener=this._listeners=this._interrupt=this._playFailed=this.pause=this.resume=this.play=this._beginPlaying=this._cleanUp=this.stop=this.setMasterVolume=this.setVolume=this.mute=this.setMute=this.getMute=this.setPan=this.getPosition=this.setPosition=this.playFailed=function(){return!1},this.getVolume=this.getPan=this.getDuration=function(){return 0},this.playState=a.PLAY_FAILED,this.toString=function(){return"[Sound Default Sound Instance]"}}function d(){}var e=a;e.DELIMITER="|",e.INTERRUPT_ANY="any",e.INTERRUPT_EARLY="early",e.INTERRUPT_LATE="late",e.INTERRUPT_NONE="none",e.PLAY_INITED="playInited",e.PLAY_SUCCEEDED="playSucceeded",e.PLAY_INTERRUPTED="playInterrupted",e.PLAY_FINISHED="playFinished",e.PLAY_FAILED="playFailed",e.SUPPORTED_EXTENSIONS=["mp3","ogg","mpeg","wav","m4a","mp4","aiff","wma","mid"],e.EXTENSION_MAP={m4a:"mp4"},e.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/,e.defaultInterruptBehavior=e.INTERRUPT_NONE,e.alternateExtensions=[],e._lastID=0,e.activePlugin=null,e._pluginsRegistered=!1,e._masterVolume=1,e._masterMute=!1,e._instances=[],e._idHash={},e._preloadHash={},e._defaultSoundInstance=null,e.addEventListener=null,e.removeEventListener=null,e.removeAllEventListeners=null,e.dispatchEvent=null,e.hasEventListener=null,e._listeners=null,createjs.EventDispatcher.initialize(e),e._sendFileLoadEvent=function(a){if(e._preloadHash[a])for(var b=0,c=e._preloadHash[a].length;c>b;b++){var d=e._preloadHash[a][b];if(e._preloadHash[a][b]=!0,e.hasEventListener("fileload")){var f=new createjs.Event("fileload");f.src=d.src,f.id=d.id,f.data=d.data,e.dispatchEvent(f)}}},e.getPreloadHandlers=function(){return{callback:createjs.proxy(e.initLoad,e),types:["sound"],extensions:e.SUPPORTED_EXTENSIONS}},e.registerPlugin=function(a){try{}catch(b){}return e._registerPlugin(a)},e._registerPlugin=function(a){return e._pluginsRegistered=!0,null==a?!1:a.isSupported()?(e.activePlugin=new a,!0):!1},e.registerPlugins=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];if(e._registerPlugin(d))return!0}return!1},e.initializeDefaultPlugins=function(){return null!=e.activePlugin?!0:e._pluginsRegistered?!1:e.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1},e.isReady=function(){return null!=e.activePlugin},e.getCapabilities=function(){return null==e.activePlugin?null:e.activePlugin._capabilities},e.getCapability=function(a){return null==e.activePlugin?null:e.activePlugin._capabilities[a]},e.initLoad=function(a,b,c,d,f){a=a.replace(f,"");var g=e.registerSound(a,c,d,!1,f);return null==g?!1:g},e.registerSound=function(a,c,d,f,g){if(!e.initializeDefaultPlugins())return!1;if(a instanceof Object&&(g=c,c=a.id,d=a.data,a=a.src),e.alternateExtensions.length)var h=e._parsePath2(a,"sound",c,d);else var h=e._parsePath(a,"sound",c,d);if(null==h)return!1;null!=g&&(a=g+a,h.src=g+h.src),null!=c&&(e._idHash[c]=h.src);var i=null;null!=d&&(isNaN(d.channels)?isNaN(d)||(i=parseInt(d)):i=parseInt(d.channels));var j=e.activePlugin.register(h.src,i);if(null!=j&&(null!=j.numChannels&&(i=j.numChannels),b.create(h.src,i),null!=d&&isNaN(d)?d.channels=h.data.channels=i||b.maxPerChannel():d=h.data=i||b.maxPerChannel(),null!=j.tag?h.tag=j.tag:j.src&&(h.src=j.src),null!=j.completeHandler&&(h.completeHandler=j.completeHandler),j.type&&(h.type=j.type)),0!=f)if(e._preloadHash[h.src]||(e._preloadHash[h.src]=[]),e._preloadHash[h.src].push({src:a,id:c,data:d}),1==e._preloadHash[h.src].length)e.activePlugin.preload(h.src,j);else if(1==e._preloadHash[h.src][0])return!0;return h},e.registerManifest=function(a,b){for(var c=[],d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.registerSound(a[d].src,a[d].id,a[d].data,a[d].preload,b);return c},e.removeSound=function(a,c){if(null==e.activePlugin)return!1;if(a instanceof Object&&(a=a.src),a=e._getSrcById(a),e.alternateExtensions.length)var d=e._parsePath2(a);else var d=e._parsePath(a);if(null==d)return!1;null!=c&&(d.src=c+d.src),a=d.src;for(var f in e._idHash)e._idHash[f]==a&&delete e._idHash[f];return b.removeSrc(a),delete e._preloadHash[a],e.activePlugin.removeSound(a),!0},e.removeManifest=function(a,b){for(var c=[],d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.removeSound(a[d].src,b);return c},e.removeAllSounds=function(){e._idHash={},e._preloadHash={},b.removeAll(),e.activePlugin.removeAllSounds()},e.loadComplete=function(a){if(e.alternateExtensions.length)var b=e._parsePath2(a,"sound");else var b=e._parsePath(a,"sound");return a=e._getSrcById(b?b.src:a),1==e._preloadHash[a][0]},e._parsePath=function(a,b,c,d){"string"!=typeof a&&(a=a.toString());var f=a.split(e.DELIMITER);if(f.length>1)try{}catch(g){}for(var h={type:b||"sound",id:c,data:d},i=e.getCapabilities(),j=0,k=f.length;k>j;j++){var l=f[j],m=l.match(e.FILE_PATTERN);if(null==m)return!1;var n=m[4],o=m[5];if(i[o]&&createjs.indexOf(e.SUPPORTED_EXTENSIONS,o)>-1)return h.name=n,h.src=l,h.extension=o,h}return null},e._parsePath2=function(a,b,c,d){"string"!=typeof a&&(a=a.toString());var f=a.match(e.FILE_PATTERN);if(null==f)return!1;for(var g=f[4],h=f[5],i=e.getCapabilities(),j=0;!i[h];)if(h=e.alternateExtensions[j++],j>e.alternateExtensions.length)return null;a=a.replace("."+f[5],"."+h);var k={type:b||"sound",id:c,data:d};return k.name=g,k.src=a,k.extension=h,k},e.play=function(a,b,c,d,f,g,h){var i=e.createInstance(a),j=e._playInstance(i,b,c,d,f,g,h);return j||i.playFailed(),i},e.createInstance=function(c){if(!e.initializeDefaultPlugins())return e._defaultSoundInstance;if(c=e._getSrcById(c),e.alternateExtensions.length)var d=e._parsePath2(c,"sound");else var d=e._parsePath(c,"sound");var f=null;return null!=d&&null!=d.src?(b.create(d.src),f=e.activePlugin.create(d.src)):f=a._defaultSoundInstance,f.uniqueId=e._lastID++,f},e.setVolume=function(a){if(null==Number(a))return!1;if(a=Math.max(0,Math.min(1,a)),e._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterVolume(a)},e.getVolume=function(){return e._masterVolume},e.setMute=function(a){if(null==a||void 0==a)return!1;if(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a);return!0},e.getMute=function(){return this._masterMute},e.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()},e._playInstance=function(a,b,c,d,f,g,h){if(b instanceof Object&&(c=b.delay,d=b.offset,f=b.loop,g=b.volume,h=b.pan,b=b.interrupt),b=b||e.defaultInterruptBehavior,null==c&&(c=0),null==d&&(d=a.getPosition()),null==f&&(f=0),null==g&&(g=a.volume),null==h&&(h=a.pan),0==c){var i=e._beginPlaying(a,b,d,f,g,h);if(!i)return!1}else{var j=setTimeout(function(){e._beginPlaying(a,b,d,f,g,h)},c);a._delayTimeoutId=j}return this._instances.push(a),!0},e._beginPlaying=function(a,c,d,e,f,g){if(!b.add(a,c))return!1;var h=a._beginPlaying(d,e,f,g);if(!h){var i=createjs.indexOf(this._instances,a);return i>-1&&this._instances.splice(i,1),!1}return!0},e._getSrcById=function(a){return null==e._idHash||null==e._idHash[a]?a:e._idHash[a]},e._playFinished=function(a){b.remove(a);var c=createjs.indexOf(this._instances,a);c>-1&&this._instances.splice(c,1)},createjs.Sound=a,b.channels={},b.create=function(a,c){var d=b.get(a);return null==d?(b.channels[a]=new b(a,c),!0):!1},b.removeSrc=function(a){var c=b.get(a);return null==c?!1:(c.removeAll(),delete b.channels[a],!0)},b.removeAll=function(){for(var a in b.channels)b.channels[a].removeAll();b.channels={}},b.add=function(a,c){var d=b.get(a.src);return null==d?!1:d.add(a,c)},b.remove=function(a){var c=b.get(a.src);return null==c?!1:(c.remove(a),!0)},b.maxPerChannel=function(){return f.maxDefault},b.get=function(a){return b.channels[a]};var f=b.prototype;f.src=null,f.max=null,f.maxDefault=100,f.length=0,f.init=function(a,b){this.src=a,this.max=b||this.maxDefault,-1==this.max&&(this.max=this.maxDefault),this._instances=[]},f.get=function(a){return this._instances[a]},f.add=function(a,b){return this.getSlot(b,a)?(this._instances.push(a),this.length++,!0):!1},f.remove=function(a){var b=createjs.indexOf(this._instances,a);return-1==b?!1:(this._instances.splice(b,1),this.length--,!0)},f.removeAll=function(){for(var a=this.length-1;a>=0;a--)this._instances[a].stop()},f.getSlot=function(b){for(var c,d,e=0,f=this.max;f>e;e++){if(c=this.get(e),null==c)return!0;(b!=a.INTERRUPT_NONE||c.playState==a.PLAY_FINISHED)&&(0!=e?c.playState==a.PLAY_FINISHED||c.playState==a.PLAY_INTERRUPTED||c.playState==a.PLAY_FAILED?d=c:(b==a.INTERRUPT_EARLY&&c.getPosition()d.getPosition())&&(d=c):d=c)}return null!=d?(d._interrupt(),this.remove(d),!0):!1},f.toString=function(){return"[Sound SoundChannel]"},a._defaultSoundInstance=new c,d.init=function(){var a=window.navigator.userAgent;d.isFirefox=a.indexOf("Firefox")>-1,d.isOpera=null!=window.opera,d.isChrome=a.indexOf("Chrome")>-1,d.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1,d.isAndroid=a.indexOf("Android")>-1,d.isBlackberry=a.indexOf("Blackberry")>-1},d.init(),createjs.Sound.BrowserDetect=d}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this._init()}var b=a;b._capabilities=null,b.isSupported=function(){var a=createjs.Sound.BrowserDetect.isIOS||createjs.Sound.BrowserDetect.isAndroid||createjs.Sound.BrowserDetect.isBlackberry;return"file:"!=location.protocol||a||this._isFileXHRSupported()?(b._generateCapabilities(),null==b.context?!1:!0):!1},b._isFileXHRSupported=function(){var a=!0,b=new XMLHttpRequest;try{b.open("GET","fail.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1},b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(c){a=!1}return a},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;if(window.webkitAudioContext)b.context=new webkitAudioContext;else{if(!window.AudioContext)return null;b.context=new AudioContext}b._compatibilitySetUp(),b.playEmptySound(),b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}b.context.destination.numberOfChannels<2&&(b._capabilities.panning=!1),b.dynamicsCompressorNode=b.context.createDynamicsCompressor(),b.dynamicsCompressorNode.connect(b.context.destination),b.gainNode=b.context.createGain(),b.gainNode.connect(b.dynamicsCompressorNode)}},b._compatibilitySetUp=function(){if(!b.context.createGain){b.context.createGain=b.context.createGainNode;var a=b.context.createBufferSource();a.__proto__.start=a.__proto__.noteGrainOn,a.__proto__.stop=a.__proto__.noteOff,this._panningModel=0}},b.playEmptySound=function(){var a=this.context.createBuffer(1,1,22050),b=this.context.createBufferSource();b.buffer=a,b.connect(this.context.destination),b.start(0,0,0)};var c=a.prototype;c._capabilities=null,c._volume=1,c.context=null,c._panningModel="equalpower",c.dynamicsCompressorNode=null,c.gainNode=null,c._arrayBuffers=null,c._init=function(){this._capabilities=b._capabilities,this._arrayBuffers={},this.context=b.context,this.gainNode=b.gainNode,this.dynamicsCompressorNode=b.dynamicsCompressorNode},c.register=function(a){this._arrayBuffers[a]=!0;var b=new createjs.WebAudioPlugin.Loader(a,this);return{tag:b}},c.isPreloadStarted=function(a){return null!=this._arrayBuffers[a]},c.isPreloadComplete=function(a){return!(null==this._arrayBuffers[a]||1==this._arrayBuffers[a])},c.removeSound=function(a){delete this._arrayBuffers[a]},c.removeAllSounds=function(){this._arrayBuffers={}},c.addPreloadResults=function(a,b){this._arrayBuffers[a]=b},c._handlePreloadComplete=function(){createjs.Sound._sendFileLoadEvent(this.src)},c.preload=function(a){this._arrayBuffers[a]=!0;var b=new createjs.WebAudioPlugin.Loader(a,this);b.onload=this._handlePreloadComplete,b.load()},c.create=function(a){return this.isPreloadStarted(a)||this.preload(a),new createjs.WebAudioPlugin.SoundInstance(a,this)},c.setVolume=function(a){return this._volume=a,this._updateVolume(),!0},c._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},c.getVolume=function(){return this._volume},c.setMute=function(){return this._updateVolume(),!0},c.toString=function(){return"[WebAudioPlugin]"},createjs.WebAudioPlugin=a}(),function(){"use strict";function a(a,b){this._init(a,b)}var b=a.prototype=new createjs.EventDispatcher;b.src=null,b.uniqueId=-1,b.playState=null,b._owner=null,b._offset=0,b._delay=0,b._volume=1;try{Object.defineProperty(b,"volume",{get:function(){return this._volume},set:function(a){return null==Number(a)?!1:(a=Math.max(0,Math.min(1,a)),this._volume=a,void this._updateVolume())}})}catch(c){}b._pan=0;try{Object.defineProperty(b,"pan",{get:function(){return this._pan},set:function(a){return this._owner._capabilities.panning&&null!=Number(a)?(a=Math.max(-1,Math.min(1,a)),this._pan=a,void this.panNode.setPosition(a,0,-.5)):!1}})}catch(c){}b._duration=0,b._remainingLoops=0,b._delayTimeoutId=null,b._soundCompleteTimeout=null,b.gainNode=null,b.panNode=null,b.sourceNode=null,b._sourceNodeNext=null,b._muted=!1,b._paused=!1,b._startTime=0,b._endedHandler=null,b._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},b._init=function(a,b){this._owner=b,this.src=a,this.gainNode=this._owner.context.createGain(),this.panNode=this._owner.context.createPanner(),this.panNode.panningModel=this._owner._panningModel,this.panNode.connect(this.gainNode),this._owner.isPreloadComplete(this.src)&&(this._duration=1e3*this._owner._arrayBuffers[this.src].duration),this._endedHandler=createjs.proxy(this._handleSoundComplete,this)},b._cleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._delayTimeoutId),clearTimeout(this._soundCompleteTimeout),this._startTime=0,null!=window.createjs&&createjs.Sound._playFinished(this)},b._cleanUpAudioNode=function(a){return a&&(a.stop(0),a.disconnect(this.panNode),a=null),a},b._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._paused=!1,this._sendEvent("interrupted")},b._handleSoundReady=function(){if(null!=window.createjs){if(1e3*this._offset>this.getDuration())return void this.playFailed();this._offset<0&&(this._offset=0),this.playState=createjs.Sound.PLAY_SUCCEEDED,this._paused=!1,this.gainNode.connect(this._owner.gainNode);var a=this._owner._arrayBuffers[this.src].duration;this.sourceNode=this._createAndPlayAudioNode(this._owner.context.currentTime-a,this._offset),this._duration=1e3*a,this._startTime=this.sourceNode.startTime-this._offset,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(a-this._offset)),0!=this._remainingLoops&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._startTime,0))}},b._createAndPlayAudioNode=function(a,b){var c=this._owner.context.createBufferSource();return c.buffer=this._owner._arrayBuffers[this.src],c.connect(this.panNode),this._owner.context.currentTime,c.startTime=a+c.buffer.duration,c.start(c.startTime,b,c.buffer.duration-b),c},b.play=function(a,b,c,d,e,f){this._cleanUp(),createjs.Sound._playInstance(this,a,b,c,d,e,f)},b._beginPlaying=function(a,b,c,d){return null!=window.createjs&&this.src?(this._offset=a/1e3,this._remainingLoops=b,this.volume=c,this.pan=d,this._owner.isPreloadComplete(this.src)?(this._handleSoundReady(null),this._sendEvent("succeeded"),1):void this.playFailed()):void 0},b.pause=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED?!1:(this._paused=!0,this._offset=this._owner.context.currentTime-this._startTime,this._cleanUpAudioNode(this.sourceNode),this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(),clearTimeout(this._delayTimeoutId),clearTimeout(this._soundCompleteTimeout),!0)},b.resume=function(){return this._paused?(this._handleSoundReady(null),!0):!1},b.stop=function(){return this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this._offset=0,!0},b.setVolume=function(a){return this.volume=a,!0},b._updateVolume=function(){var a=this._muted?0:this._volume;return a!=this.gainNode.gain.value?(this.gainNode.gain.value=a,!0):!1},b.getVolume=function(){return this.volume},b.setMute=function(a){return null==a||void 0==a?!1:(this._muted=a,this._updateVolume(),!0)},b.getMute=function(){return this._muted},b.setPan=function(a){return this.pan=a,this.pan!=a?!1:void 0},b.getPan=function(){return this.pan},b.getPosition=function(){if(this._paused||null==this.sourceNode)var a=this._offset;else var a=this._owner.context.currentTime-this._startTime;return 1e3*a },b.setPosition=function(a){return this._offset=a/1e3,this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._cleanUpAudioNode(this.sourceNode),this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout)),this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||this._handleSoundReady(null),!0},b.getDuration=function(){return this._duration},b._handleSoundComplete=function(){return this._offset=0,0!=this._remainingLoops?(this._remainingLoops--,this._sourceNodeNext?(this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._startTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._startTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)):this._handleSoundReady(null),void this._sendEvent("loop")):void(null!=window.createjs&&(this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this._sendEvent("complete")))},b.playFailed=function(){null!=window.createjs&&(this._cleanUp(),this.playState=createjs.Sound.PLAY_FAILED,this._sendEvent("failed"))},b.toString=function(){return"[WebAudioPlugin SoundInstance]"},createjs.WebAudioPlugin.SoundInstance=a}(),function(){"use strict";function a(a,b){this._init(a,b)}var b=a.prototype;b.request=null,b.owner=null,b.progress=-1,b.src=null,b.originalSrc=null,b.result=null,b.onload=null,b.onprogress=null,b.onError=null,b._init=function(a,b){this.src=a,this.originalSrc=a,this.owner=b},b.load=function(a){null!=a&&(this.src=a),this.request=new XMLHttpRequest,this.request.open("GET",this.src,!0),this.request.responseType="arraybuffer",this.request.onload=createjs.proxy(this.handleLoad,this),this.request.onError=createjs.proxy(this.handleError,this),this.request.onprogress=createjs.proxy(this.handleProgress,this),this.request.send()},b.handleProgress=function(a,b){this.progress=a/b,null!=this.onprogress&&this.onprogress({loaded:a,total:b,progress:this.progress})},b.handleLoad=function(){this.owner.context.decodeAudioData(this.request.response,createjs.proxy(this.handleAudioDecoded,this),createjs.proxy(this.handleError,this))},b.handleAudioDecoded=function(a){this.progress=1,this.result=a,this.src=this.originalSrc,this.owner.addPreloadResults(this.src,this.result),this.onload&&this.onload()},b.handleError=function(a){this.owner.removeSound(this.src),this.onerror&&this.onerror(a)},b.toString=function(){return"[WebAudioPlugin Loader]"},createjs.WebAudioPlugin.Loader=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this._init()}var b=a;b.MAX_INSTANCES=30,b._AUDIO_READY="canplaythrough",b._AUDIO_ENDED="ended",b._AUDIO_SEEKED="seeked",b._AUDIO_STALLED="stalled",b._capabilities=null,b.enableIOS=!1,b.isSupported=function(){if(createjs.Sound.BrowserDetect.isIOS&&!b.enableIOS)return!1;b._generateCapabilities();var a=b.tag;return null==a||null==b._capabilities?!1:!0},b._generateCapabilities=function(){if(null==b._capabilities){var a=b.tag=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}};var c=a.prototype;c._capabilities=null,c._audioSources=null,c.defaultNumChannels=2,c.loadedHandler=null,c._init=function(){this._capabilities=b._capabilities,this._audioSources={}},c.register=function(a,b){this._audioSources[a]=!0;for(var c=createjs.HTMLAudioPlugin.TagPool.get(a),d=null,e=b||this.defaultNumChannels,f=0;e>f;f++)d=this._createTag(a),c.add(d);if(d.id=a,this.loadedHandler=createjs.proxy(this._handleTagLoad,this),d.addEventListener&&d.addEventListener("canplaythrough",this.loadedHandler),null==d.onreadystatechange)d.onreadystatechange=this.loadedHandler;else{var g=d.onreadystatechange;d.onreadystatechange=function(){g(),this.loadedHandler()}}return{tag:d,numChannels:e}},c._handleTagLoad=function(a){a.target.removeEventListener&&a.target.removeEventListener("canplaythrough",this.loadedHandler),a.target.onreadystatechange=null,a.target.src!=a.target.id&&createjs.HTMLAudioPlugin.TagPool.checkSrc(a.target.id)},c._createTag=function(a){var b=document.createElement("audio");return b.autoplay=!1,b.preload="none",b.src=a,b},c.removeSound=function(a){delete this._audioSources[a],createjs.HTMLAudioPlugin.TagPool.remove(a)},c.removeAllSounds=function(){this._audioSources={},createjs.HTMLAudioPlugin.TagPool.removeAll()},c.create=function(a){if(!this.isPreloadStarted(a)){var b=createjs.HTMLAudioPlugin.TagPool.get(a),c=this._createTag(a);c.id=a,b.add(c),this.preload(a,{tag:c})}return new createjs.HTMLAudioPlugin.SoundInstance(a,this)},c.isPreloadStarted=function(a){return null!=this._audioSources[a]},c.preload=function(a,b){this._audioSources[a]=!0,new createjs.HTMLAudioPlugin.Loader(a,b.tag)},c.toString=function(){return"[HTMLAudioPlugin]"},createjs.HTMLAudioPlugin=a}(),function(){"use strict";function a(a,b){this._init(a,b)}var b=a.prototype=new createjs.EventDispatcher;b.src=null,b.uniqueId=-1,b.playState=null,b._owner=null,b.loaded=!1,b._offset=0,b._delay=0,b._volume=1;try{Object.defineProperty(b,"volume",{get:function(){return this._volume},set:function(a){null!=Number(a)&&(a=Math.max(0,Math.min(1,a)),this._volume=a,this._updateVolume())}})}catch(c){}b.pan=0,b._duration=0,b._remainingLoops=0,b._delayTimeoutId=null,b.tag=null,b._muted=!1,b._paused=!1,b._endedHandler=null,b._readyHandler=null,b._stalledHandler=null,b.loopHandler=null,b._init=function(a,b){this.src=a,this._owner=b,this._endedHandler=createjs.proxy(this._handleSoundComplete,this),this._readyHandler=createjs.proxy(this._handleSoundReady,this),this._stalledHandler=createjs.proxy(this._handleSoundStalled,this),this.loopHandler=createjs.proxy(this.handleSoundLoop,this)},b._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},b._cleanUp=function(){var a=this.tag;if(null!=a){a.pause(),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1);try{a.currentTime=0}catch(b){}createjs.HTMLAudioPlugin.TagPool.setInstance(this.src,a),this.tag=null}clearTimeout(this._delayTimeoutId),null!=window.createjs&&createjs.Sound._playFinished(this)},b._interrupt=function(){null!=this.tag&&(this.playState=createjs.Sound.PLAY_INTERRUPTED,this._cleanUp(),this._paused=!1,this._sendEvent("interrupted"))},b.play=function(a,b,c,d,e,f){this._cleanUp(),createjs.Sound._playInstance(this,a,b,c,d,e,f)},b._beginPlaying=function(a,b,c,d){if(null==window.createjs)return-1;var e=this.tag=createjs.HTMLAudioPlugin.TagPool.getInstance(this.src);return null==e?(this.playFailed(),-1):(e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._offset=a,this.volume=c,this.pan=d,this._updateVolume(),this._remainingLoops=b,4!==e.readyState?(e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),e.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),e.preload="auto",e.load()):this._handleSoundReady(null),this._sendEvent("succeeded"),1)},b._handleSoundStalled=function(){this._cleanUp(),this._sendEvent("failed")},b._handleSoundReady=function(){if(null!=window.createjs){if(this._duration=1e3*this.tag.duration,this.playState=createjs.Sound.PLAY_SUCCEEDED,this._paused=!1,this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._offset>=this.getDuration())return void this.playFailed();this._offset>0&&(this.tag.currentTime=.001*this._offset),-1==this._remainingLoops&&(this.tag.loop=!0),0!=this._remainingLoops&&(this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1),this.tag.loop=!0),this.tag.play()}},b.pause=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||null==this.tag?!1:(this._paused=!0,this.tag.pause(),clearTimeout(this._delayTimeoutId),!0)},b.resume=function(){return this._paused&&null!=this.tag?(this._paused=!1,this.tag.play(),!0):!1},b.stop=function(){return this._offset=0,this.pause(),this.playState=createjs.Sound.PLAY_FINISHED,this._cleanUp(),!0},b.setMasterVolume=function(){return this._updateVolume(),!0},b.setVolume=function(a){return this.volume=a,!0},b._updateVolume=function(){if(null!=this.tag){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;return a!=this.tag.volume&&(this.tag.volume=a),!0}return!1},b.getVolume=function(){return this.volume},b.setMasterMute=function(){return this._updateVolume(),!0},b.setMute=function(a){return null==a||void 0==a?!1:(this._muted=a,this._updateVolume(),!0)},b.getMute=function(){return this._muted},b.setPan=function(){return!1},b.getPan=function(){return 0},b.getPosition=function(){return null==this.tag?this._offset:1e3*this.tag.currentTime},b.setPosition=function(a){if(null==this.tag)this._offset=a;else{this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1);try{this.tag.currentTime=.001*a}catch(b){return!1}this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1)}return!0},b.getDuration=function(){return this._duration},b._handleSoundComplete=function(){this._offset=0,null!=window.createjs&&(this.playState=createjs.Sound.PLAY_FINISHED,this._cleanUp(),this._sendEvent("complete"))},b.handleSoundLoop=function(){this._offset=0,this._remainingLoops--,0==this._remainingLoops&&(this.tag.loop=!1,this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this.loopHandler,!1)),this._sendEvent("loop")},b.playFailed=function(){null!=window.createjs&&(this.playState=createjs.Sound.PLAY_FAILED,this._cleanUp(),this._sendEvent("failed"))},b.toString=function(){return"[HTMLAudioPlugin SoundInstance]"},createjs.HTMLAudioPlugin.SoundInstance=a}(),function(){"use strict";function a(a,b){this._init(a,b)}var b=a.prototype;b.src=null,b.tag=null,b.preloadTimer=null,b.loadedHandler=null,b._init=function(a,b){if(this.src=a,this.tag=b,this.preloadTimer=setInterval(createjs.proxy(this.preloadTick,this),200),this.loadedHandler=createjs.proxy(this.sendLoadedEvent,this),this.tag.addEventListener&&this.tag.addEventListener("canplaythrough",this.loadedHandler),null==this.tag.onreadystatechange)this.tag.onreadystatechange=createjs.proxy(this.sendLoadedEvent,this);else{var c=this.tag.onreadystatechange;this.tag.onreadystatechange=function(){c(),this.tag.onreadystatechange=createjs.proxy(this.sendLoadedEvent,this)}}this.tag.preload="auto",this.tag.load()},b.preloadTick=function(){var a=this.tag.buffered,b=this.tag.duration;a.length>0&&a.end(0)>=b-1&&this.handleTagLoaded()},b.handleTagLoaded=function(){clearInterval(this.preloadTimer)},b.sendLoadedEvent=function(){this.tag.removeEventListener&&this.tag.removeEventListener("canplaythrough",this.loadedHandler),this.tag.onreadystatechange=null,createjs.Sound._sendFileLoadEvent(this.src)},b.toString=function(){return"[HTMLAudioPlugin Loader]"},createjs.HTMLAudioPlugin.Loader=a}(),function(){"use strict";function a(a){this._init(a)}var b=a;b.tags={},b.get=function(c){var d=b.tags[c];return null==d&&(d=b.tags[c]=new a(c)),d},b.remove=function(a){var c=b.tags[a];return null==c?!1:(c.removeAll(),delete b.tags[a],!0)},b.removeAll=function(){for(var a in b.tags)b.tags[a].removeAll();b.tags={}},b.getInstance=function(a){var c=b.tags[a];return null==c?null:c.get()},b.setInstance=function(a,c){var d=b.tags[a];return null==d?null:d.set(c)},b.checkSrc=function(a){var c=b.tags[a];return null==c?null:void c.checkSrcChange()};var c=a.prototype;c.src=null,c.length=0,c.available=0,c.tags=null,c._init=function(a){this.src=a,this.tags=[]},c.add=function(a){this.tags.push(a),this.length++,this.available++},c.removeAll=function(){for(;this.length--;)delete this.tags[this.length];this.src=null,this.tags.length=0},c.get=function(){if(0==this.tags.length)return null;this.available=this.tags.length;var a=this.tags.pop();return null==a.parentNode&&document.body.appendChild(a),a},c.set=function(a){var b=createjs.indexOf(this.tags,a);-1==b&&this.tags.push(a),this.available=this.tags.length},c.checkSrcChange=function(){for(var a=this.tags.length-1,b=this.tags[a].src;a--;)this.tags[a].src=b},c.toString=function(){return"[HTMLAudioPlugin TagPool]"},createjs.HTMLAudioPlugin.TagPool=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype;b.type=null,b.target=null,b.currentTarget=null,b.eventPhase=0,b.bubbles=!1,b.cancelable=!1,b.timeStamp=0,b.defaultPrevented=!1,b.propagationStopped=!1,b.immediatePropagationStopped=!1,b.removed=!1,b.initialize=function(a,b,c){this.type=a,this.bubbles=b,this.cancelable=c,this.timeStamp=(new Date).getTime()},b.preventDefault=function(){this.defaultPrevented=!0},b.stopPropagation=function(){this.propagationStopped=!0},b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},b.remove=function(){this.removed=!0},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)},b.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){this.initialize()},b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.on=b.on,a.removeEventListener=a.off=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent,a._dispatchEvent=b._dispatchEvent},b._listeners=null,b._captureListeners=null,b.initialize=function(){},b.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},b.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},b.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},b.off=b.removeEventListener,b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},b.dispatchEvent=function(a,b){if("string"==typeof a){var c=this._listeners;if(!c||!c[a])return!1;a=new createjs.Event(a)}if(a.target=b||this,a.bubbles&&this.parent){for(var d=this,e=[d];d.parent;)e.push(d=d.parent);var f,g=e.length;for(f=g-1;f>=0&&!a.propagationStopped;f--)e[f]._dispatchEvent(a,1+(0==f));for(f=1;g>f&&!a.propagationStopped;f++)e[f]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return a.defaultPrevented},b.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},b.toString=function(){return"[EventDispatcher]"},b._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;a.currentTarget=this,a.eventPhase=b,a.removed=!1,e=e.slice();for(var f=0;c>f&&!a.immediatePropagationStopped;f++){var g=e[f];g.handleEvent?g.handleEvent(a):g(a),a.removed&&(this.off(a.type,g,1==b),a.removed=!1)}}},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype=new createjs.EventDispatcher;a.NONE=0,a.LOOP=1,a.REVERSE=2,a.IGNORE={},a._tweens=[],a._plugins={},a.get=function(b,c,d,e){return e&&a.removeTweens(b),new a(b,c,d)},a.tick=function(b,c){for(var d=a._tweens.slice(),e=d.length-1;e>=0;e--){var f=d[e];c&&!f.ignoreGlobalPause||f._paused||f.tick(f._useTicks?1:b)}},a.handleEvent=function(a){"tick"==a.type&&this.tick(a.delta,a.paused)},a.removeTweens=function(b){if(b.tweenjs_count){for(var c=a._tweens,d=c.length-1;d>=0;d--)c[d]._target==b&&(c[d]._paused=!0,c.splice(d,1));b.tweenjs_count=0}},a.removeAllTweens=function(){for(var b=a._tweens,c=0,d=b.length;d>c;c++){var e=b[c];e.paused=!0,e.target.tweenjs_count=0}b.length=0},a.hasActiveTweens=function(b){return b?b.tweenjs_count:a._tweens&&!!a._tweens.length},a.installPlugin=function(b,c){var d=b.priority;null==d&&(b.priority=d=0);for(var e=0,f=c.length,g=a._plugins;f>e;e++){var h=c[e];if(g[h]){for(var i=g[h],j=0,k=i.length;k>j&&!(d=a)return this;var c=this._cloneProps(this._curQueueProps);return this._addStep({d:a,p0:c,e:this._linearEase,p1:c,v:b})},b.to=function(a,b,c){return(isNaN(b)||0>b)&&(b=0),this._addStep({d:b||0,p0:this._cloneProps(this._curQueueProps),e:c,p1:this._cloneProps(this._appendQueueProps(a))})},b.call=function(a,b,c){return this._addAction({f:a,p:b?b:[this],o:c?c:this._target})},b.set=function(a,b){return this._addAction({f:this._set,o:this,p:[a,b?b:this._target]})},b.play=function(a){return a||(a=this),this.call(a.setPaused,[!1],a)},b.pause=function(a){return a||(a=this),this.call(a.setPaused,[!0],a)},b.setPosition=function(a,b){0>a&&(a=0),null==b&&(b=1);var c=a,d=!1;if(c>=this.duration&&(this.loop?c%=this.duration:(c=this.duration,d=!0)),c==this._prevPos)return d;var e=this._prevPos;if(this.position=this._prevPos=c,this._prevPosition=a,this._target)if(d)this._updateTargetProps(null,1);else if(this._steps.length>0){for(var f=0,g=this._steps.length;g>f&&!(this._steps[f].t>c);f++);var h=this._steps[f-1];this._updateTargetProps(h,(this._stepPosition=c-h.t)/h.d)}return 0!=b&&this._actions.length>0&&(this._useTicks?this._runActions(c,c):1==b&&e>c?(e!=this.duration&&this._runActions(e,this.duration),this._runActions(0,c,!0)):this._runActions(e,c)),d&&this.setPaused(!0),this.dispatchEvent("change"),d},b.tick=function(a){this._paused||this.setPosition(this._prevPosition+a)},b.setPaused=function(b){return this._paused=!!b,a._register(this,!b),this},b.w=b.wait,b.t=b.to,b.c=b.call,b.s=b.set,b.toString=function(){return"[Tween]"},b.clone=function(){throw"Tween can not be cloned."},b._updateTargetProps=function(b,c){var d,e,f,g,h,i;if(b||1!=c){if(this.passive=!!b.v,this.passive)return;b.e&&(c=b.e(c,0,1,1)),d=b.p0,e=b.p1}else this.passive=!1,d=e=this._curQueueProps;for(var j in this._initQueueProps){null==(g=d[j])&&(d[j]=g=this._initQueueProps[j]),null==(h=e[j])&&(e[j]=h=g),f=g==h||0==c||1==c||"number"!=typeof g?1==c?h:g:g+(h-g)*c;var k=!1;if(i=a._plugins[j])for(var l=0,m=i.length;m>l;l++){var n=i[l].tween(this,j,f,d,e,c,!!b&&d==e,!b);n==a.IGNORE?k=!0:f=n}k||(this._target[j]=f)}},b._runActions=function(a,b,c){var d=a,e=b,f=-1,g=this._actions.length,h=1;for(a>b&&(d=b,e=a,f=g,g=h=-1);(f+=h)!=g;){var i=this._actions[f],j=i.t;(j==e||j>d&&e>j||c&&j==a)&&i.f.apply(i.o,i.p)}},b._appendQueueProps=function(b){var c,d,e,f,g;for(var h in b)if(void 0===this._initQueueProps[h]){if(d=this._target[h],c=a._plugins[h])for(e=0,f=c.length;f>e;e++)d=c[e].init(this,h,d);this._initQueueProps[h]=this._curQueueProps[h]=void 0===d?null:d}else d=this._curQueueProps[h];for(var h in b){if(d=this._curQueueProps[h],c=a._plugins[h])for(g=g||{},e=0,f=c.length;f>e;e++)c[e].step&&c[e].step(this,h,d,b[h],g);this._curQueueProps[h]=b[h]}return g&&this._appendQueueProps(g),this._curQueueProps},b._cloneProps=function(a){var b={};for(var c in a)b[c]=a[c];return b},b._addStep=function(a){return a.d>0&&(this._steps.push(a),a.t=this.duration,this.duration+=a.d),this},b._addAction=function(a){return a.t=this.duration,this._actions.push(a),this},b._set=function(a,b){for(var c in a)b[c]=a[c]},createjs.Tween=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(a,b,c){this.initialize(a,b,c)},b=a.prototype=new createjs.EventDispatcher;b.ignoreGlobalPause=!1,b.duration=0,b.loop=!1,b.position=null,b._paused=!1,b._tweens=null,b._labels=null,b._labelList=null,b._prevPosition=0,b._prevPos=-1,b._useTicks=!1,b.initialize=function(a,b,c){this._tweens=[],c&&(this._useTicks=c.useTicks,this.loop=c.loop,this.ignoreGlobalPause=c.ignoreGlobalPause,c.onChange&&this.addEventListener("change",c.onChange)),a&&this.addTween.apply(this,a),this.setLabels(b),c&&c.paused?this._paused=!0:createjs.Tween._register(this,!0),c&&null!=c.position&&this.setPosition(c.position,createjs.Tween.NONE)},b.addTween=function(a){var b=arguments.length;if(b>1){for(var c=0;b>c;c++)this.addTween(arguments[c]);return arguments[0]}return 0==b?null:(this.removeTween(a),this._tweens.push(a),a.setPaused(!0),a._paused=!1,a._useTicks=this._useTicks,a.duration>this.duration&&(this.duration=a.duration),this._prevPos>=0&&a.setPosition(this._prevPos,createjs.Tween.NONE),a)},b.removeTween=function(a){var b=arguments.length;if(b>1){for(var c=!0,d=0;b>d;d++)c=c&&this.removeTween(arguments[d]);return c}if(0==b)return!1;for(var e=this._tweens,d=e.length;d--;)if(e[d]==a)return e.splice(d,1),a.duration>=this.duration&&this.updateDuration(),!0;return!1},b.addLabel=function(a,b){this._labels[a]=b;var c=this._labelList;if(c){for(var d=0,e=c.length;e>d&&!(bd&&!(ba&&(a=0);var c=this.loop?a%this.duration:a,d=!this.loop&&a>=this.duration;if(c==this._prevPos)return d;this._prevPosition=a,this.position=this._prevPos=c;for(var e=0,f=this._tweens.length;f>e;e++)if(this._tweens[e].setPosition(c,b),c!=this._prevPos)return!1;return d&&this.setPaused(!0),this.dispatchEvent("change"),d},b.setPaused=function(a){this._paused=!!a,createjs.Tween._register(this,!a)},b.updateDuration=function(){this.duration=0;for(var a=0,b=this._tweens.length;b>a;a++){var c=this._tweens[a];c.duration>this.duration&&(this.duration=c.duration)}},b.tick=function(a){this.setPosition(this._prevPosition+a)},b.resolve=function(a){var b=parseFloat(a);return isNaN(b)&&(b=this._labels[a]),b},b.toString=function(){return"[Timeline]"},b.clone=function(){throw"Timeline can not be cloned."},b._goto=function(a){var b=this.resolve(a);null!=b&&this.setPosition(b)},createjs.Timeline=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){throw"Ease cannot be instantiated."};a.linear=function(a){return a},a.none=a.linear,a.get=function(a){return-1>a&&(a=-1),a>1&&(a=1),function(b){return 0==a?b:0>a?b*(b*-a+1+a):b*((2-b)*a+(1-a))}},a.getPowIn=function(a){return function(b){return Math.pow(b,a)}},a.getPowOut=function(a){return function(b){return 1-Math.pow(1-b,a)}},a.getPowInOut=function(a){return function(b){return(b*=2)<1?.5*Math.pow(b,a):1-.5*Math.abs(Math.pow(2-b,a))}},a.quadIn=a.getPowIn(2),a.quadOut=a.getPowOut(2),a.quadInOut=a.getPowInOut(2),a.cubicIn=a.getPowIn(3),a.cubicOut=a.getPowOut(3),a.cubicInOut=a.getPowInOut(3),a.quartIn=a.getPowIn(4),a.quartOut=a.getPowOut(4),a.quartInOut=a.getPowInOut(4),a.quintIn=a.getPowIn(5),a.quintOut=a.getPowOut(5),a.quintInOut=a.getPowInOut(5),a.sineIn=function(a){return 1-Math.cos(a*Math.PI/2)},a.sineOut=function(a){return Math.sin(a*Math.PI/2)},a.sineInOut=function(a){return-.5*(Math.cos(Math.PI*a)-1)},a.getBackIn=function(a){return function(b){return b*b*((a+1)*b-a)}},a.backIn=a.getBackIn(1.7),a.getBackOut=function(a){return function(b){return--b*b*((a+1)*b+a)+1}},a.backOut=a.getBackOut(1.7),a.getBackInOut=function(a){return a*=1.525,function(b){return(b*=2)<1?.5*b*b*((a+1)*b-a):.5*((b-=2)*b*((a+1)*b+a)+2)}},a.backInOut=a.getBackInOut(1.7),a.circIn=function(a){return-(Math.sqrt(1-a*a)-1)},a.circOut=function(a){return Math.sqrt(1- --a*a)},a.circInOut=function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},a.bounceIn=function(b){return 1-a.bounceOut(1-b)},a.bounceOut=function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},a.bounceInOut=function(b){return.5>b?.5*a.bounceIn(2*b):.5*a.bounceOut(2*b-1)+.5},a.getElasticIn=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return-(a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b))}},a.elasticIn=a.getElasticIn(1,.3),a.getElasticOut=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return a*Math.pow(2,-10*d)*Math.sin((d-e)*c/b)+1}},a.elasticOut=a.getElasticOut(1,.3),a.getElasticInOut=function(a,b){var c=2*Math.PI;return function(d){var e=b/c*Math.asin(1/a);return(d*=2)<1?-.5*a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b):.5*a*Math.pow(2,-10*(d-=1))*Math.sin((d-e)*c/b)+1}},a.elasticInOut=a.getElasticInOut(1,.3*1.5),createjs.Ease=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=function(){throw"MotionGuidePlugin cannot be instantiated."};a.priority=0,a._rotOffS,a._rotOffE,a._rotNormS,a._rotNormE,a.install=function(){return createjs.Tween.installPlugin(a,["guide","x","y","rotation"]),createjs.Tween.IGNORE},a.init=function(a,b,c){var d=a.target;return d.hasOwnProperty("x")||(d.x=0),d.hasOwnProperty("y")||(d.y=0),d.hasOwnProperty("rotation")||(d.rotation=0),"rotation"==b&&(a.__needsRot=!0),"guide"==b?null:c},a.step=function(b,c,d,e,f){if("rotation"==c&&(b.__rotGlobalS=d,b.__rotGlobalE=e,a.testRotData(b,f)),"guide"!=c)return e;var g,h=e;h.hasOwnProperty("path")||(h.path=[]);var i=h.path;if(h.hasOwnProperty("end")||(h.end=1),h.hasOwnProperty("start")||(h.start=d&&d.hasOwnProperty("end")&&d.path===i?d.end:0),h.hasOwnProperty("_segments")&&h._length)return e;var j=i.length,k=10;if(!(j>=6&&0==(j-2)%4))throw"invalid 'path' data, please see documentation for valid paths";h._segments=[],h._length=0;for(var l=2;j>l;l+=4){for(var m,n,o=i[l-2],p=i[l-1],q=i[l+0],r=i[l+1],s=i[l+2],t=i[l+3],u=o,v=p,w=0,x=[],y=1;k>=y;y++){var z=y/k,A=1-z;m=A*A*o+2*A*z*q+z*z*s,n=A*A*p+2*A*z*r+z*z*t,w+=x[x.push(Math.sqrt((g=m-u)*g+(g=n-v)*g))-1],u=m,v=n}h._segments.push(w),h._segments.push(x),h._length+=w}g=h.orient,h.orient=!0;var B={};return a.calc(h,h.start,B),b.__rotPathS=Number(B.rotation.toFixed(5)),a.calc(h,h.end,B),b.__rotPathE=Number(B.rotation.toFixed(5)),h.orient=!1,a.calc(h,h.end,f),h.orient=g,h.orient?(b.__guideData=h,a.testRotData(b,f),e):e},a.testRotData=function(a,b){if(void 0===a.__rotGlobalS||void 0===a.__rotGlobalE){if(a.__needsRot)return;a.__rotGlobalS=a.__rotGlobalE=void 0!==a._curQueueProps.rotation?a._curQueueProps.rotation:b.rotation=a.target.rotation||0}if(void 0!==a.__guideData){var c=a.__guideData,d=a.__rotGlobalE-a.__rotGlobalS,e=a.__rotPathE-a.__rotPathS,f=d-e;if("auto"==c.orient)f>180?f-=360:-180>f&&(f+=360);else if("cw"==c.orient){for(;0>f;)f+=360;0==f&&d>0&&180!=d&&(f+=360)}else if("ccw"==c.orient){for(f=d-(e>180?360-e:e);f>0;)f-=360;0==f&&0>d&&-180!=d&&(f-=360)}c.rotDelta=f,c.rotOffS=a.__rotGlobalS-a.__rotPathS,a.__rotGlobalS=a.__rotGlobalE=a.__guideData=a.__needsRot=void 0}},a.tween=function(b,c,d,e,f,g,h){var i=f.guide;if(void 0==i||i===e.guide)return d;if(i.lastRatio!=g){var j=(i.end-i.start)*(h?i.end:g)+i.start;switch(a.calc(i,j,b.target),i.orient){case"cw":case"ccw":case"auto":b.target.rotation+=i.rotOffS+i.rotDelta*g;break;case"fixed":default:b.target.rotation+=i.rotOffS}i.lastRatio=g}return"rotation"!=c||i.orient&&"false"!=i.orient?b.target[c]:d},a.calc=function(b,c,d){void 0==b._segments&&a.validate(b),void 0==d&&(d={x:0,y:0,rotation:0});for(var e=b._segments,f=b.path,g=b._length*c,h=e.length-2,i=0;g>e[i]&&h>i;)g-=e[i],i+=2;var j=e[i+1],k=0;for(h=j.length-1;g>j[k]&&h>k;)g-=j[k],k++;var l=k/++h+g/(h*j[k]);i=2*i+2;var m=1-l;return d.x=m*m*f[i-2]+2*m*l*f[i+0]+l*l*f[i+2],d.y=m*m*f[i-1]+2*m*l*f[i+1]+l*l*f[i+3],b.orient&&(d.rotation=57.2957795*Math.atan2((f[i+1]-f[i-1])*m+(f[i+3]-f[i+1])*l,(f[i+0]-f[i-2])*m+(f[i+2]-f[i+0])*l)),d},createjs.MotionGuidePlugin=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=createjs.TweenJS=createjs.TweenJS||{};a.version="0.5.0",a.buildDate="Wed, 25 Sep 2013 17:09:35 GMT"}();var Scroller;!function(){var a=function(){};Scroller=function(b,c){this.__callback=b,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:a,penetrationDeceleration:.03,penetrationAcceleration:.08};for(var d in c)this.options[d]=c[d]};var b=function(a){return Math.pow(a-1,3)+1},c=function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},d={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(a,b,c,d){var e=this;a===+a&&(e.__clientWidth=a),b===+b&&(e.__clientHeight=b),c===+c&&(e.__contentWidth=c),d===+d&&(e.__contentHeight=d),e.__computeScrollMax(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)},setPosition:function(a,b){var c=this;c.__clientLeft=a||0,c.__clientTop=b||0},setSnapSize:function(a,b){var c=this;c.__snapWidth=a,c.__snapHeight=b},activatePullToRefresh:function(a,b,c,d){var e=this;e.__refreshHeight=a,e.__refreshActivate=b,e.__refreshDeactivate=c,e.__refreshStart=d},triggerPullToRefresh:function(){this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()},finishPullToRefresh:function(){var a=this;a.__refreshActive=!1,a.__refreshDeactivate&&a.__refreshDeactivate(),a.scrollTo(a.__scrollLeft,a.__scrollTop,!0)},getValues:function(){var a=this;return{left:a.__scrollLeft,top:a.__scrollTop,zoom:a.__zoomLevel}},getScrollMax:function(){var a=this;return{left:a.__maxScrollLeft,top:a.__maxScrollTop}},zoomTo:function(a,b,c,d){var e=this;if(!e.options.zooming)throw new Error("Zooming is not pickerEnabled!");e.__isDecelerating&&(core.effect.Animate.stop(e.__isDecelerating),e.__isDecelerating=!1);var f=e.__zoomLevel; null==c&&(c=e.__clientWidth/2),null==d&&(d=e.__clientHeight/2),a=Math.max(Math.min(a,e.options.maxZoom),e.options.minZoom),e.__computeScrollMax(a);var g=(c+e.__scrollLeft)*a/f-c,h=(d+e.__scrollTop)*a/f-d;g>e.__maxScrollLeft?g=e.__maxScrollLeft:0>g&&(g=0),h>e.__maxScrollTop?h=e.__maxScrollTop:0>h&&(h=0),e.__publish(g,h,a,b)},zoomBy:function(a,b,c,d){var e=this;e.zoomTo(e.__zoomLevel*a,b,c,d)},scrollTo:function(a,b,c,d){var e=this;if(e.__isDecelerating&&(core.effect.Animate.stop(e.__isDecelerating),e.__isDecelerating=!1),null!=d&&d!==e.__zoomLevel){if(!e.options.zooming)throw new Error("Zooming is not pickerEnabled!");a*=d,b*=d,e.__computeScrollMax(d)}else d=e.__zoomLevel;e.options.scrollingX?e.options.paging?a=Math.round(a/e.__clientWidth)*e.__clientWidth:e.options.snapping&&(a=Math.round(a/e.__snapWidth)*e.__snapWidth):a=e.__scrollLeft,e.options.scrollingY?e.options.paging?b=Math.round(b/e.__clientHeight)*e.__clientHeight:e.options.snapping&&(b=Math.round(b/e.__snapHeight)*e.__snapHeight):b=e.__scrollTop,a=Math.max(Math.min(e.__maxScrollLeft,a),0),b=Math.max(Math.min(e.__maxScrollTop,b),0),a===e.__scrollLeft&&b===e.__scrollTop&&(c=!1),e.__publish(a,b,d,c)},scrollBy:function(a,b,c){var d=this,e=d.__isAnimating?d.__scheduledLeft:d.__scrollLeft,f=d.__isAnimating?d.__scheduledTop:d.__scrollTop;d.scrollTo(e+(a||0),f+(b||0),c)},doMouseZoom:function(a,b,c,d){var e=this,f=a>0?.97:1.03;return e.zoomTo(e.__zoomLevel*f,!1,c-e.__clientLeft,d-e.__clientTop)},doTouchStart:function(a,b){if(null==a.length)throw new Error("Invalid touch list: "+a);if(b instanceof Date&&(b=b.valueOf()),"number"!=typeof b)throw new Error("Invalid timestamp value: "+b);var c=this;c.__interruptedAnimation=!0,c.__isDecelerating&&(core.effect.Animate.stop(c.__isDecelerating),c.__isDecelerating=!1,c.__interruptedAnimation=!0),c.__isAnimating&&(core.effect.Animate.stop(c.__isAnimating),c.__isAnimating=!1,c.__interruptedAnimation=!0);var d,e,f=1===a.length;f?(d=a[0].pageX,e=a[0].pageY):(d=Math.abs(a[0].pageX+a[1].pageX)/2,e=Math.abs(a[0].pageY+a[1].pageY)/2),c.__initialTouchLeft=d,c.__initialTouchTop=e,c.__zoomLevelStart=c.__zoomLevel,c.__lastTouchLeft=d,c.__lastTouchTop=e,c.__lastTouchMove=b,c.__lastScale=1,c.__enableScrollX=!f&&c.options.scrollingX,c.__enableScrollY=!f&&c.options.scrollingY,c.__isTracking=!0,c.__didDecelerationComplete=!1,c.__isDragging=!f,c.__isSingleTouch=f,c.__positions=[]},doTouchMove:function(a,b,c){if(null==a.length)throw new Error("Invalid touch list: "+a);if(b instanceof Date&&(b=b.valueOf()),"number"!=typeof b)throw new Error("Invalid timestamp value: "+b);var d=this;if(d.__isTracking){var e,f;2===a.length?(e=Math.abs(a[0].pageX+a[1].pageX)/2,f=Math.abs(a[0].pageY+a[1].pageY)/2):(e=a[0].pageX,f=a[0].pageY);var g=d.__positions;if(d.__isDragging){var h=e-d.__lastTouchLeft,i=f-d.__lastTouchTop,j=d.__scrollLeft,k=d.__scrollTop,l=d.__zoomLevel;if(null!=c&&d.options.zooming){var m=l;if(l=l/d.__lastScale*c,l=Math.max(Math.min(l,d.options.maxZoom),d.options.minZoom),m!==l){var n=e-d.__clientLeft,o=f-d.__clientTop;j=(n+j)*l/m-n,k=(o+k)*l/m-o,d.__computeScrollMax(l)}}if(d.__enableScrollX){j-=h*this.options.speedMultiplier;var p=d.__maxScrollLeft;(j>p||0>j)&&(d.options.bouncing?j+=h/2*this.options.speedMultiplier:j=j>p?p:0)}if(d.__enableScrollY){k-=i*this.options.speedMultiplier;var q=d.__maxScrollTop;(k>q||0>k)&&(d.options.bouncing?(k+=i/2*this.options.speedMultiplier,d.__enableScrollX||null==d.__refreshHeight||(!d.__refreshActive&&k<=-d.__refreshHeight?(d.__refreshActive=!0,d.__refreshActivate&&d.__refreshActivate()):d.__refreshActive&&k>-d.__refreshHeight&&(d.__refreshActive=!1,d.__refreshDeactivate&&d.__refreshDeactivate()))):k=k>q?q:0)}g.length>60&&g.splice(0,30),g.push(j,k,b),d.__publish(j,k,l)}else{var r=d.options.locking?3:0,s=5,t=Math.abs(e-d.__initialTouchLeft),u=Math.abs(f-d.__initialTouchTop);d.__enableScrollX=d.options.scrollingX&&t>=r,d.__enableScrollY=d.options.scrollingY&&u>=r,g.push(d.__scrollLeft,d.__scrollTop,b),d.__isDragging=(d.__enableScrollX||d.__enableScrollY)&&(t>=s||u>=s),d.__isDragging&&(d.__interruptedAnimation=!1)}d.__lastTouchLeft=e,d.__lastTouchTop=f,d.__lastTouchMove=b,d.__lastScale=c}},doTouchEnd:function(a){if(a instanceof Date&&(a=a.valueOf()),"number"!=typeof a)throw new Error("Invalid timestamp value: "+a);var b=this;if(b.__isTracking){if(b.__isTracking=!1,b.__isDragging)if(b.__isDragging=!1,b.__isSingleTouch&&b.options.animating&&a-b.__lastTouchMove<=100){for(var c=b.__positions,d=c.length-1,e=d,f=d;f>0&&c[f]>b.__lastTouchMove-100;f-=3)e=f;if(e!==d){var g=c[d]-c[e],h=b.__scrollLeft-c[e-2],i=b.__scrollTop-c[e-1];b.__decelerationVelocityX=h/g*(1e3/60),b.__decelerationVelocityY=i/g*(1e3/60);var j=b.options.paging||b.options.snapping?4:1;(Math.abs(b.__decelerationVelocityX)>j||Math.abs(b.__decelerationVelocityY)>j)&&(b.__refreshActive||b.__startDeceleration(a))}else b.options.scrollingComplete()}else a-b.__lastTouchMove>100&&b.options.scrollingComplete();b.__isDecelerating||(b.__refreshActive&&b.__refreshStart?(b.__publish(b.__scrollLeft,-b.__refreshHeight,b.__zoomLevel,!0),b.__refreshStart&&b.__refreshStart()):((b.__interruptedAnimation||b.__isDragging)&&b.options.scrollingComplete(),b.scrollTo(b.__scrollLeft,b.__scrollTop,!0,b.__zoomLevel),b.__refreshActive&&(b.__refreshActive=!1,b.__refreshDeactivate&&b.__refreshDeactivate()))),b.__positions.length=0}},__publish:function(a,d,e,f){var g=this,h=g.__isAnimating;if(h&&(core.effect.Animate.stop(h),g.__isAnimating=!1),f&&g.options.animating){g.__scheduledLeft=a,g.__scheduledTop=d,g.__scheduledZoom=e;var i=g.__scrollLeft,j=g.__scrollTop,k=g.__zoomLevel,l=a-i,m=d-j,n=e-k,o=function(a,b,c){c&&(g.__scrollLeft=i+l*a,g.__scrollTop=j+m*a,g.__zoomLevel=k+n*a,g.__callback&&g.__callback(g.__scrollLeft,g.__scrollTop,g.__zoomLevel))},p=function(a){return g.__isAnimating===a},q=function(a,b,c){b===g.__isAnimating&&(g.__isAnimating=!1),(g.__didDecelerationComplete||c)&&g.options.scrollingComplete(),g.options.zooming&&g.__computeScrollMax()};g.__isAnimating=core.effect.Animate.start(o,p,q,g.options.animationDuration,h?b:c)}else g.__scheduledLeft=g.__scrollLeft=a,g.__scheduledTop=g.__scrollTop=d,g.__scheduledZoom=g.__zoomLevel=e,g.__callback&&g.__callback(a,d,e),g.options.zooming&&g.__computeScrollMax()},__computeScrollMax:function(a){var b=this;null==a&&(a=b.__zoomLevel),b.__maxScrollLeft=Math.max(b.__contentWidth*a-b.__clientWidth,0),b.__maxScrollTop=Math.max(b.__contentHeight*a-b.__clientHeight,0)},__startDeceleration:function(){var a=this;if(a.options.paging){var b=Math.max(Math.min(a.__scrollLeft,a.__maxScrollLeft),0),c=Math.max(Math.min(a.__scrollTop,a.__maxScrollTop),0),d=a.__clientWidth,e=a.__clientHeight;a.__minDecelerationScrollLeft=Math.floor(b/d)*d,a.__minDecelerationScrollTop=Math.floor(c/e)*e,a.__maxDecelerationScrollLeft=Math.ceil(b/d)*d,a.__maxDecelerationScrollTop=Math.ceil(c/e)*e}else a.__minDecelerationScrollLeft=0,a.__minDecelerationScrollTop=0,a.__maxDecelerationScrollLeft=a.__maxScrollLeft,a.__maxDecelerationScrollTop=a.__maxScrollTop;var f=function(b,c,d){a.__stepThroughDeceleration(d)},g=a.options.snapping?4:.1,h=function(){var b=Math.abs(a.__decelerationVelocityX)>=g||Math.abs(a.__decelerationVelocityY)>=g;return b||(a.__didDecelerationComplete=!0),b},i=function(){a.__isDecelerating=!1,a.__didDecelerationComplete&&a.options.scrollingComplete(),a.scrollTo(a.__scrollLeft,a.__scrollTop,a.options.snapping)};a.__isDecelerating=core.effect.Animate.start(f,h,i)},__stepThroughDeceleration:function(a){var b=this,c=b.__scrollLeft+b.__decelerationVelocityX,d=b.__scrollTop+b.__decelerationVelocityY;if(!b.options.bouncing){var e=Math.max(Math.min(b.__maxDecelerationScrollLeft,c),b.__minDecelerationScrollLeft);e!==c&&(c=e,b.__decelerationVelocityX=0);var f=Math.max(Math.min(b.__maxDecelerationScrollTop,d),b.__minDecelerationScrollTop);f!==d&&(d=f,b.__decelerationVelocityY=0)}if(a?b.__publish(c,d,b.__zoomLevel):(b.__scrollLeft=c,b.__scrollTop=d),!b.options.paging){var g=.95;b.__decelerationVelocityX*=g,b.__decelerationVelocityY*=g}if(b.options.bouncing){var h=0,i=0,j=b.options.penetrationDeceleration,k=b.options.penetrationAcceleration;cb.__maxDecelerationScrollLeft&&(h=b.__maxDecelerationScrollLeft-c),db.__maxDecelerationScrollTop&&(i=b.__maxDecelerationScrollTop-d),0!==h&&(h*b.__decelerationVelocityX<=0?b.__decelerationVelocityX+=h*j:b.__decelerationVelocityX=h*k),0!==i&&(i*b.__decelerationVelocityY<=0?b.__decelerationVelocityY+=i*j:b.__decelerationVelocityY=i*k)}}};for(var e in d)Scroller.prototype[e]=d[e]}(),function(a){var b=Date.now||function(){return+new Date},c=60,d=1e3,e={},f=1;a.core?core.effect||(core.effect={}):a.core={effect:{}},core.effect.Animate={requestAnimationFrame:function(){var b=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame,c=!!b;if(b&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(b.toString())&&(c=!1),c)return function(a,c){b(a,c)};var d=60,e={},f=0,g=1,h=null,i=+new Date;return function(a){var b=g++;return e[b]=a,f++,null===h&&(h=setInterval(function(){var a=+new Date,b=e;e={},f=0;for(var c in b)b.hasOwnProperty(c)&&(b[c](a),i=a);a-i>2500&&(clearInterval(h),h=null)},1e3/d)),b}}(),stop:function(a){var b=null!=e[a];return b&&(e[a]=null),b},isRunning:function(a){return null!=e[a]},start:function(a,g,h,i,j,k){var l=b(),m=l,n=0,o=0,p=f++;if(k||(k=document.body),p%20===0){var q={};for(var r in e)q[r]=!0;e=q}var s=function(f){var q=f!==!0,r=b();if(!e[p]||g&&!g(p))return e[p]=null,void(h&&h(c-o/((r-l)/d),p,!1));if(q)for(var t=Math.round((r-m)/(d/c))-1,u=0;u1&&(n=1));var v=j?j(n):n;a(v,r,q)!==!1&&1!==n||!q?q&&(m=r,core.effect.Animate.requestAnimationFrame(s,k)):(e[p]=null,h&&h(c-o/((r-l)/d),p,1===n||null==i))};return e[p]=!0,core.effect.Animate.requestAnimationFrame(s,k),p}}}(this);var spritesheets;(spritesheets||(spritesheets={}))["comix-jellyquest"]={framerate:24,images:["comix-jellyquest.jpg"],frames:[[861,2,297,404,0,-41,0],[579,2,278,416,0,-339,-3],[595,1028,574,229,0,-36,-422],[1745,643,298,30,0,-175,-672],[1162,643,579,268,0,-33,-9],[2,643,578,381,0,-33,-286],[2,1028,589,264,0,-24,0],[1718,2,248,83,0,-229,-209],[1162,2,552,393,0,-47,-274],[2,2,573,637,0,-31,-19],[584,643,574,289,0,-19,-328],[1173,1028,557,87,0,-27,-580]],animations:{ComixFrame_3_3:{frames:[8],speed:1},ComixFrame_2_2:{frames:[5],speed:1},ComixFrame_4_3:{frames:[11],speed:1},ComixFrame_4_2:{frames:[10],speed:1},ComixFrame_1_2:{frames:[1],speed:1},ComixFrame_4_1:{frames:[9],speed:1},ComixFrame_1_1:{frames:[0],speed:1},ComixFrame_2_1:{frames:[4],speed:1},ComixFrame_3_2:{frames:[7],speed:1},ComixFrame_1_3:{frames:[2],speed:1},ComixFrame_3_1:{frames:[6],speed:1},ComixContinue:{frames:[3],speed:1}}};var spritesheets;(spritesheets||(spritesheets={}))["spritesheet-jellyquest"]={framerate:24,images:["spritesheet-jellyquest.png"],frames:[[1718,714,73,74,0,37,37],[1795,714,73,74,0,36,37],[1504,714,73,74,0,37,37],[1888,282,125,127,0,0,0],[1623,282,64,127,0,0,0],[1015,802,127,64,0,-1,-1],[1344,802,64,64,0,-1,-1],[2,470,64,127,0,-1,0],[1146,802,126,64,0,-1,-1],[1691,282,125,127,0,-1,0],[879,802,64,64,0,0,-1],[1820,282,64,127,0,0,-1],[1542,802,126,64,0,0,-1],[267,470,125,127,0,0,0],[1276,802,64,64,0,-1,0],[199,470,64,127,0,0,0],[1412,802,126,64,0,0,0],[527,470,125,127,0,0,0],[70,470,125,127,0,0,-1],[1803,802,126,64,0,0,-1],[1933,802,64,64,0,-1,-1],[447,880,64,63,0,0,3],[899,714,158,80,0,-1,0],[815,714,80,80,0,0,-1],[899,282,157,163,0,-1,0],[1425,282,126,129,0,-2,1],[1060,282,80,159,0,0,0],[115,880,128,63,0,1,0],[379,880,64,63,0,0,3],[311,880,64,63,0,0,3],[2,880,64,64,0,-1,0],[254,1012,34,34,0,16,17],[533,1012,645,26,0,-1,13],[986,470,110,112,0,55,56],[1442,470,110,112,0,55,56],[1144,282,136,143,0,-6,0],[1426,948,29,43,0,-1,6],[2017,282,29,50,0,-1,13],[2017,601,29,50,0,-1,13],[1357,880,60,61,0,0,6],[1180,880,60,61,0,0,6],[494,802,42,65,0,1,5],[769,802,42,65,0,1,5],[723,802,42,65,0,1,5],[1558,948,29,43,0,0,5],[1624,948,29,43,0,0,5],[1525,948,29,43,0,0,5],[843,948,60,57,0,0,6],[942,880,60,61,0,0,6],[1581,714,56,74,0,0,14],[815,802,60,65,0,0,14],[832,880,42,61,0,5,6],[1972,601,41,74,0,4,6],[2001,802,41,63,0,4,6],[580,948,41,57,0,4,6],[1393,948,29,43,0,0,6],[1591,948,29,43,0,0,6],[878,880,60,61,0,-1,6],[1006,880,60,61,0,-1,6],[786,880,42,61,0,4,6],[1872,714,41,74,0,3,6],[70,880,41,63,0,3,6],[798,948,41,57,0,3,6],[1690,948,29,43,0,-1,6],[1459,948,29,43,0,-1,6],[1492,948,29,43,0,-1,6],[1116,880,60,61,0,-1,5],[2,802,60,74,0,-1,5],[247,880,60,63,0,-1,5],[734,948,60,57,0,-1,5],[689,948,41,57,0,3,6],[1070,880,42,61,0,4,6],[1917,714,38,74,0,8,14],[540,802,41,65,0,3,14],[1657,948,29,43,0,-1,6],[1723,948,29,43,0,-1,6],[1756,948,29,43,0,-1,6],[677,802,42,65,0,1,5],[631,802,42,65,0,1,5],[585,802,42,65,0,1,5],[625,948,60,57,0,-1,6],[1421,880,60,61,0,-1,6],[1959,714,56,74,0,-1,14],[430,802,60,65,0,-1,14],[659,880,123,62,0,31,31],[947,802,64,64,0,-1,-1],[1555,282,64,129,0,0,-1],[2,714,644,84,0,-1,1],[730,714,81,81,0,41,40],[2,1012,248,39,0,-3,-3],[292,1012,237,29,0,-10,-7],[1793,601,82,85,0,40,41],[1328,470,110,112,0,56,56],[359,601,112,107,0,56,53],[475,601,112,107,0,56,52],[1142,714,78,78,0,37,37],[515,880,68,62,0,38,27],[1981,880,58,57,0,29,23],[587,880,68,62,0,31,26],[1061,714,77,78,0,38,37],[1705,601,84,86,0,38,42],[1879,601,89,82,0,43,39],[1128,948,49,51,0,25,25],[1789,948,51,39,0,26,18],[1181,948,39,51,0,20,24],[1075,948,49,51,0,25,24],[2,282,120,184,0,3,4],[2019,714,16,16,0,4,4],[724,470,120,121,0,-3,-3],[1987,2,59,122,0,-2,-2],[1697,880,122,60,0,-3,-3],[1485,880,59,60,0,-3,-3],[848,470,134,115,0,66,51],[1284,282,137,134,0,66,63],[126,282,150,174,0,66,74],[800,2,156,223,0,66,95],[360,2,172,252,0,66,108],[2,2,188,276,0,66,115],[536,2,260,240,0,66,121],[194,2,162,263,0,66,85],[1791,470,149,109,0,61,29],[66,802,147,72,0,75,36],[2,601,109,109,0,53,57],[362,802,64,65,0,-1,-1],[1672,802,127,64,0,0,-1],[396,470,127,127,0,0,-1],[656,470,64,127,0,-1,-1],[1641,714,73,74,0,36,36],[217,802,71,72,0,36,35],[1020,948,51,52,0,25,27],[1563,601,138,98,0,66,72],[1678,470,109,109,0,53,57],[907,948,109,55,0,54,27],[1214,470,110,112,0,56,55],[1100,470,110,112,0,56,55],[1944,470,83,87,0,-21,108],[1224,714,276,76,0,138,38],[1614,2,197,206,0,98,103],[1844,948,16,16,0,4,4],[292,802,66,66,0,31,28],[115,601,118,109,0,58,54],[1556,470,118,109,0,58,54],[237,601,118,109,0,58,54],[1244,880,109,61,0,55,-10],[1280,948,109,50,0,54,-10],[1224,948,52,50,0,25,-21],[453,282,442,167,0,241,85],[960,2,214,218,0,101,137],[1178,2,214,218,0,100,136],[1396,2,214,218,0,100,136],[650,714,76,84,0,39,34],[1548,880,145,60,0,71,33],[2,948,268,60,0,133,33],[274,948,302,59,0,147,29],[1823,880,154,58,0,71,28],[915,601,104,106,0,53,52],[1023,601,104,106,0,52,52],[591,601,104,106,0,52,52],[1131,601,104,106,0,53,51],[1347,601,104,106,0,52,51],[1239,601,104,106,0,52,51],[1455,601,104,106,0,53,52],[699,601,104,106,0,52,52],[807,601,104,106,0,52,52],[280,282,169,169,0,82,70],[1815,2,168,195,0,85,98]],animations:{Marmalade1x2_2:{speed:1,frames:[7]},JellyFace2_2x1:{speed:1,frames:[66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,67,67,67,67,67,67,67,67,67,67,67,68,68,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69]},ProfessorNormal:{speed:1,frames:[147]},ColumnClearPowerup:{speed:1,frames:[104]},GameShopBuyButtonDisabled:{speed:1,frames:[131]},TutorialWindow:{speed:1,frames:[146]},ShopPowerupLocked:{speed:1,frames:[132]},QuitButton:{speed:1,frames:[33]},YesButton:{speed:1,frames:[133]},JellyFace2_1x2:{speed:1,frames:[70,70,70,71,71,71,71,71,71,71,71,71,71,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73]},Marmalade2x2_2:{speed:1,frames:[9]},JellyFace4_1x1:{speed:1,frames:[36,36,36,36,36,37,37,37,37,37,37,37,37,37,37,36,36,36,36,36,36,36,36,36,36,36,36,36,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36]},Marmalade2x1_1:{speed:1,frames:[5]},Marmalade1x1_2:{speed:1,frames:[85]},Chocolate1x2:{speed:1,frames:[126]},JellyFace3_1x1:{speed:1,frames:[55,55,55,55,55,55,55,55,55,56,56,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55]},ProgressBarBack:{speed:1,frames:[89]},Marmalade1x1_1:{speed:1,frames:[6]},ProfessorHappy:{speed:1,frames:[148]},JellyDicePowerupButton:{speed:1,frames:[91]},BlackRect:{speed:1,frames:[107]},MapStars3:{speed:1,frames:[143]},CurrentLevelMarker:{speed:1,frames:[135]},MoreGamesButton:{speed:1,frames:[136]},Marmalade2x1_2:{speed:1,frames:[8]},MusicButtonOn:{speed:1,frames:[2]},Marmalade1x2_0:{speed:1,frames:[11]},Marmalade2x1_3:{speed:1,frames:[19]},ShopStarCounter:{speed:1,frames:[121]},SoundFXButtonOff:{speed:1,frames:[128]},JellyFace4_2x1:{speed:1,frames:[39,39,39,39,39,39,39,39,39,40,40,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39,39]},ProfessorScared:{speed:1,frames:[149]},NoButton:{speed:1,frames:[134]},Chocolate2x1:{speed:1,frames:[124]},MapStars1:{speed:1,frames:[145]},Fruit2x1_4:{speed:1,frames:[27]},SoundFXButtonOn:{speed:1,frames:[1]},JellyFace3_2x1:{speed:1,frames:[57,57,57,57,57,57,57,57,57,58,58,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57]},JellyFace3_1x2:{speed:1,frames:[59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,59,60,60,60,60,60,60,60,60,60,60,60,61,61,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62]},HintArrow:{speed:1,frames:[150]},Marmalade2x1_W:{speed:1,frames:[110]},GoalTitle:{speed:1,frames:[151]},Marmalade1x1_0:{speed:1,frames:[10]},Marmalade1x1_W:{speed:1,frames:[111]},GlueyBlock1_2x1:{speed:1,frames:[84]},Marmalade2x2_0:{speed:1,frames:[13]},RowClearPowerup:{speed:1,frames:[103]},Marmalade1x1_4:{speed:1,frames:[14]},Fruit1x1_2:{speed:1,frames:[28]},MapGameShopButton:{speed:1,frames:[34]},HudIconBoss:{speed:1,frames:[139]},Fruit1x1_3:{speed:1,frames:[21]},Marmalade1x2_W:{speed:1,frames:[109]},ProgressBarLine:{speed:1,frames:[90]},CompleteTitle:{speed:1,frames:[152]},Chocolate1x1:{speed:1,frames:[123]},PlayButton:{speed:1,frames:[137]},BombPowerup:{speed:1,frames:[105]},Marmalade2x1_0:{speed:1,frames:[12]},MusicButtonOff:{speed:1,frames:[127]},LevelUnlocked:{speed:1,frames:[141]},LevelComplete:{speed:1,frames:[140]},ExtraMoves1:{speed:1,frames:[155]},HudIconFruitsAndCookies:{speed:1,frames:[98]},Marmalade2x1_4:{speed:1,frames:[16]},LevelLocked:{speed:1,frames:[142]},JellyFace4_1x2:{speed:1,frames:[41,42,43,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41]},PauseTitle:{speed:1,frames:[154]},MapStars2:{speed:1,frames:[144]},HudIconScore:{speed:1,frames:[95]},GameOverTitle:{speed:1,frames:[153]},RestartButton:{speed:1,frames:[92]},TaskIcons:{speed:1,frames:[99,100,101]},CreditsButton:{speed:1,frames:[0]},WhiteRect:{speed:1,frames:[138]},GameShopBuyButton:{speed:1,frames:[122]},Fruit2x2_2:{speed:1,frames:[25]},JellyFace0_1x1:{speed:1,frames:[74,75,76,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74,74]},Marmalade1x2_4:{speed:1,frames:[15]},JellyFace1_1x1:{speed:1,frames:[44,45,46,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44]},StarDisabled:{speed:1,frames:[94]},StarEnabled:{speed:1,frames:[93]},ExtraMoves2:{speed:1,frames:[156]},Fruit1x1_4:{speed:1,frames:[29]},ExtraMoves3:{speed:1,frames:[157]},PauseButton:{speed:1,frames:[88]},HudIconCookies:{speed:1,frames:[97]},Shuffle1:{speed:1,frames:[158]},MapLeftPanel:{speed:1,frames:[35]},PlusPowerup:{speed:1,frames:[102]},Explosion:{speed:1,frames:[112,113,114,115,116,117,118,119,120]},HudIconFruits:{speed:1,frames:[96]},Marmalade2x2_4:{speed:1,frames:[17]},BombChain:{speed:1,frames:[160]},ShopPowerupEquipped:{speed:1,frames:[129]},Shuffle2:{speed:1,frames:[159]},BonusPack3:{speed:1,frames:[163]},Candy1x1:{speed:1,frames:[30]},BonusPack1:{speed:1,frames:[161]},JellyFace0_2x1:{speed:1,frames:[80,80,80,81,81,81,81,81,81,81,81,81,81,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83,83]},BonusPack2:{speed:1,frames:[162]},Marmalade1x2_1:{speed:1,frames:[4]},Marmalade1x1_3:{speed:1,frames:[20]},InGamePanelBack:{speed:1,frames:[87]},Chocolate2x2:{speed:1,frames:[125]},ShopPowerupHighlighted:{speed:1,frames:[130]},BossHead:{speed:1,frames:[164]},FruitCounter:{speed:1,frames:[31]},JellyFace1_1x2:{speed:1,frames:[51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,51,52,52,52,52,52,52,52,52,52,52,52,53,53,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54]},BossHeadScream:{speed:1,frames:[165]},Ice2x2:{speed:1,frames:[24]},JellyFace0_1x2:{speed:1,frames:[77,78,79,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77,77]},JellyFace2_1x1:{speed:1,frames:[63,64,65,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63]},Footer:{speed:1,frames:[32]},Highlight:{speed:1,frames:[106]},Ice1x2:{speed:1,frames:[26]},Marmalade2x2_1:{speed:1,frames:[3]},Marmalade1x2_3:{speed:1,frames:[86]},JellyFace1_2x1:{speed:1,frames:[47,47,47,48,48,48,48,48,48,48,48,48,48,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50]},Ice2x1:{speed:1,frames:[22]},Marmalade2x2_W:{speed:1,frames:[108]},Ice1x1:{speed:1,frames:[23]},Marmalade2x2_3:{speed:1,frames:[18]}}};var resources;!function(a){a.layout={TitleScreen:{registrationPoint:{id:"registrationPoint",x:636.45,y:259.85},CreditsButton:{id:"CreditsButton",x:54.75,y:49.65,w:72,h:73.4},GameTitle:{id:"GameTitle",x:0,y:72.2,w:651,h:308.5},SoundFXButton:{id:"SoundFXButton",x:596,y:49.65,w:72,h:73.4},MusicButton:{id:"MusicButton",x:517.95,y:49.65,w:72,h:73.4},PlayButton:{id:"PlayButton",x:320,y:492.95,w:196.5,h:205.95},MoreGamesButton:{id:"MoreGamesButton",x:490.55,y:648,w:274.95,h:75.75},SponsorLogo:{id:"SponsorLogo",x:162.55,y:648,w:274.95,h:75.75}},GameOverScreen:{PanelBackground:{id:"PanelBackground",x:16,y:61,w:562.1,h:575.45},QuitButton:{id:"QuitButton",x:223.25,y:573.2,w:109.35,h:111.5},LevelScores:{id:"LevelScores",x:342.15,y:367.15,w:206,h:78.9},RestartButton:{id:"RestartButton",x:460,y:569.8,w:109.35,h:111.5},Level:{id:"Level",x:343.35,y:331,w:124.3,h:78.9},MapGameShopButton:{id:"MapGameShopButton",x:342.05,y:569.8,w:109.35,h:111.5},Avatar:{id:"Avatar",x:552.95,y:297.75,w:133.25,h:136.6},GameOverTitle:{id:"GameOverTitle",x:301.7,y:272.75,w:296.8,h:53.85},Hint:{id:"Hint",x:342.05,y:432.15,w:74.55,h:78.9}},GamePauseScreen:{PanelBackground:{id:"PanelBackground",x:16,y:61,w:562.1,h:575.45},QuitButton:{id:"QuitButton",x:191.2,y:569.9,w:109.35,h:111.5},PlayButton:{id:"PlayButton",x:452.15,y:566.5,w:99.05,h:103.8},RestartButton:{id:"RestartButton",x:322.75,y:569.9,w:109.35,h:111.5},SoundFXButton:{id:"SoundFXButton",x:542,y:148,w:72,h:73.4},MusicButton:{id:"MusicButton",x:450,y:148,w:72,h:73.4},GoalText:{id:"GoalText",x:320.05,y:339.95,w:250.5,h:78.9},GoalIcon:{id:"GoalIcon",x:330,y:446.8,w:99.05,h:103.8},PauseTitle:{id:"PauseTitle",x:333.95,y:270.3,w:152.35,h:57.55},SponsorLogo:{id:"SponsorLogo",x:240.65,y:148,w:274.95,h:75.75}},LevelCompleteScreen:{PanelBackground:{id:"PanelBackground",x:16,y:61,w:562.1,h:575.45},QuitButton:{id:"QuitButton",x:221.25,y:575.2,w:109.35,h:111.5},PlayButton:{id:"PlayButton",x:462.2,y:571.8,w:99.05,h:103.8},LevelScores:{id:"LevelScores",x:342.15,y:394.15,w:206,h:78.9},StarPanel:{id:"StarPanel",x:346.7,y:150.9,w:231.1,h:129},RestartButton:{id:"RestartButton",x:340,y:571.8,w:109.35,h:111.5},TotalScores:{id:"TotalScores",x:341.6,y:456.8,w:297.5,h:78.9},Level:{id:"Level",x:343.35,y:327,w:124.3,h:78.9},Avatar:{id:"Avatar",x:530.55,y:288.75,w:133.25,h:136.6},CompleteTitle:{id:"CompleteTitle",x:292.25,y:268.15,w:267.05,h:58.95}},GameScreen:{InGamePanelBack:{id:"InGamePanelBack",x:0,y:-2,w:643.25,h:82.4},PauseButton:{id:"PauseButton",x:49.35,y:43.85,w:80.2,h:80.45},ScoreText:{id:"ScoreText",x:200,y:7.1,w:192.05,h:29},MovesText:{id:"MovesText",x:421.4,y:6,w:103.9,h:29},ScoreProgress:{id:"ScoreProgress",x:101,y:39,w:236.6,h:28.4},JellyDicePowerupButton:{id:"JellyDicePowerupButton",x:594.5,y:42.6,w:81.2,h:83.95},MovesCollectionTarget:{id:"MovesCollectionTarget",x:521,y:10,w:30,h:30},GoalCollectionTarget:{id:"GoalCollectionTarget",x:224,y:60,w:30,h:30},TutorialWindow:{id:"TutorialWindow",x:252.8,y:220.4,w:437.8,h:163.8},HintArrow:{id:"HintArrow",x:471,y:70,w:56.6,h:56.6},StarProgress:{id:"StarProgress",x:117,y:23,w:33.3,h:31.9},GoalText:{id:"GoalText",x:134,y:43.1,w:192.05,h:29},CollectiblesText:{id:"CollectiblesText",x:190,y:43.1,w:192.05,h:29},BossHead:{id:"BossHead",x:313.65,y:116.85,w:175,h:205},BottomTutorialWindow:{id:"BottomTutorialWindow",x:252.8,y:596.4,w:437.8,h:163.8}},GoalScreen:{PanelBackground:{id:"PanelBackground",x:16,y:61,w:562.1,h:575.45},QuitButton:{id:"QuitButton",x:201.4,y:568.15,w:109.35,h:111.5},PlayButton:{id:"PlayButton",x:442.35,y:564.75,w:99.05,h:103.8},GoalText:{id:"GoalText",x:310.25,y:338.2,w:250.5,h:78.9},StarPanel:{id:"StarPanel",x:319.95,y:173.9,w:231.1,h:129},GoalIcon:{id:"GoalIcon",x:315.95,y:446.7,w:99.05,h:103.8},MapGameShopButton:{id:"MapGameShopButton",x:321.65,y:564.75,w:109.35,h:111.5},Avatar:{id:"Avatar",x:536.95,y:275.75,w:133.25,h:136.6},GoalTitle:{id:"GoalTitle",x:332.6,y:270,w:143.95,h:59.35}},MapScreen:{level1:{id:"level1",x:80.25,y:3512.15,w:116.85,h:108.9},level2:{id:"level2",x:223.35,y:3423.55,w:116.85,h:108.9},level3:{id:"level3",x:386,y:3512,w:116.85,h:108.9},level4:{id:"level4",x:507.2,y:3387.1,w:116.85,h:108.9},level5:{id:"level5",x:533.2,y:3211.55,w:116.85,h:108.9},level6:{id:"level6",x:363.65,y:3102.65,w:116.85,h:108.9},level7:{id:"level7",x:173.15,y:3169.6,w:116.85,h:108.9},level8:{id:"level8",x:87.1,y:3024.15,w:116.85,h:108.9},level9:{id:"level9",x:186.05,y:2886.45,w:116.85,h:108.9},level10:{id:"level10",x:329.2,y:2772.95,w:116.85,h:108.9},level11:{id:"level11",x:250,y:2360,w:116.85,h:108.9},level12:{id:"level12",x:90,y:2257.45,w:116.85,h:108.9},level13:{id:"level13",x:240,y:2144.45,w:116.85,h:108.9},level14:{id:"level14",x:440,y:2130,w:116.85,h:108.9},level15:{id:"level15",x:360,y:1920,w:116.85,h:108.9},level16:{id:"level16",x:190,y:2e3,w:116.85,h:108.9},level17:{id:"level17",x:80,y:1850,w:116.85,h:108.9},level18:{id:"level18",x:220,y:1720,w:116.85,h:108.9},level19:{id:"level19",x:410,y:1710,w:116.85,h:108.9},level20:{id:"level20",x:510,y:1580,w:116.85,h:108.9},level21:{id:"level21",x:450,y:1160,w:116.85,h:108.9},level22:{id:"level22",x:280,y:1090,w:116.85,h:108.9},level23:{id:"level23",x:110,y:1020,w:116.85,h:108.9},level24:{id:"level24",x:160,y:870,w:116.85,h:108.9},level25:{id:"level25",x:350,y:850,w:116.85,h:108.9},level26:{id:"level26",x:560,y:860,w:116.85,h:108.9},level27:{id:"level27",x:470,y:670,w:116.85,h:108.9},level28:{id:"level28",x:271.55,y:664.45,w:116.85,h:108.9},level29:{id:"level29",x:120,y:560,w:116.85,h:108.9},level30:{id:"level30",x:250,y:430,w:116.85,h:108.9}},PowerupPanel:{powerup1:{id:"powerup1",x:113,y:297,w:135.8,h:131.7},powerup2:{id:"powerup2",x:252,y:297,w:135.9,h:131.6},powerup3:{id:"powerup3",x:391,y:297,w:136.05,h:131.6},powerup4:{id:"powerup4",x:530,y:297,w:136,h:131.6},powerup5:{id:"powerup5",x:113,y:500,w:135.9,h:131.7},powerup6:{id:"powerup6",x:252,y:499,w:135.85,h:131.75},powerup7:{id:"powerup7",x:391,y:500,w:136.1,h:131.45},powerup8:{id:"powerup8",x:530,y:500,w:136.05,h:131.75},CloseButton:{id:"CloseButton",x:566,y:80,w:62.8,h:60.85},PowerupsDialogTitle:{id:"PowerupsDialogTitle",x:320,y:143,w:428.35,h:69.55}},StarPanel:{Star1:{id:"Star1",x:-66.45,y:-22.9,w:111.1,h:106.45},Star3:{id:"Star3",x:56.5,y:-23.8,w:111.05,h:106.4},Star2:{id:"Star2",x:-3,y:.45,w:111.05,h:106.4}},MapPanel:{QuitButton:{id:"QuitButton",x:63.15,y:66.4,w:109.35,h:111.5},MapLeftPanel:{id:"MapLeftPanel",x:-7,y:-.6,w:141.95,h:142.15},MapRightPanel:{id:"MapRightPanel",x:647.2,y:-.6,w:141.95,h:142.15},MapGameShopButton:{id:"MapGameShopButton",x:576.05,y:66.4,w:109.35,h:111.5}},BossGameScreen:{BossHealth:{id:"BossHealth",x:17,y:53,w:162.45,h:29},ScoreText:{id:"ScoreText",x:410.8,y:33.6,w:202.8,h:75.45},GameMenuButton:{id:"GameMenuButton",x:241,y:57,w:89.6,h:86.9},PowerupButton:{id:"PowerupButton",x:336,y:57,w:89.65,h:86.9}},TreasureDialog:{TreasureTitle:{id:"TreasureTitle",x:320,y:126,w:534.15,h:206},TreasureHint:{id:"TreasureHint",x:320,y:409.95,w:104,h:95.4},CollectTreasureButton:{id:"CollectTreasureButton",x:320,y:582,w:335.4,h:129.6},TreasureIcon:{id:"TreasureIcon",x:320,y:320,w:136.05,h:131.75}},PowerupDialogLine:{PowerupDialogLineBackground:{id:"PowerupDialogLineBackground",x:0,y:0,w:558.75,h:143.4},PowerupIcon:{id:"PowerupIcon",x:-190.4,y:3.95,w:136.05,h:131.75},PowerupCaption:{id:"PowerupCaption",x:-114.35,y:-55.4,w:149.1,h:34.4},CoinIcon:{id:"CoinIcon",x:160.65,y:-22,w:39.95,h:40},CoinsText:{id:"CoinsText",x:179.65,y:-59.3,w:70.55,h:75.45},PowerupDescription:{id:"PowerupDescription",x:-114.35,y:-24.6,w:381.7,h:33.2},PowerupQty:{id:"PowerupQty",x:-114.35,y:34.4,w:381.7,h:25.9},NextPowerupDialogLineBackground:{id:"NextPowerupDialogLineBackground",x:0,y:168.25,w:558.75,h:143.4},BuyPowerupButton:{id:"BuyPowerupButton",x:188.65,y:32,w:146.75,h:56.7}},PowerupShop:{PowerupShopBackground:{id:"PowerupShopBackground",x:0,y:35,w:655.9,h:664.2},ExtraMoves1:{id:"ExtraMoves1",x:190.05,y:264.35,w:103.85,h:105.2},ExtraMoves2:{id:"ExtraMoves2",x:327.05,y:264.05,w:103.85,h:105.2},ExtraMoves3:{id:"ExtraMoves3",x:462,y:264.05,w:103.85,h:105.2},Shuffle1:{id:"Shuffle1",x:190.05,y:411.25,w:103.85,h:105.2},BombChain:{id:"BombChain",x:462,y:411.25,w:103.85,h:105.2},BonusPack1:{id:"BonusPack1",x:327.05,y:411.25,w:103.85,h:105.2},QuitButton:{id:"QuitButton",x:68,y:62,w:109.35,h:111.5},PowerupDescription:{id:"PowerupDescription",x:73.5,y:565.85,w:155.7,h:33.05},ShopStarCounter:{id:"ShopStarCounter",x:228,y:60,w:143.8,h:71.95},GameShopBuyButton:{id:"GameShopBuyButton",x:533.6,y:619.2,w:108.4,h:108.4},StarCount:{id:"StarCount",x:226.25,y:35.25,w:61,h:63.55},RestartButton:{id:"RestartButton",x:330.45,y:62,w:72.95,h:71.95}},CreditsScreen:{QuitButton:{id:"QuitButton",x:320,y:635.8,w:99.05,h:103.8}},TutorialWindow:{TutorialWindow:{id:"TutorialWindow",x:2.8,y:10.4,w:437.8,h:163.8},Avatar:{id:"Avatar",x:259.8,y:35.75,w:211,h:216.4},TutorialText:{id:"TutorialText",x:-15.45,y:-39.5,w:344.1,h:19}},InfoDialog:{PanelBackground:{id:"PanelBackground",x:16,y:61,w:562.1,h:575.45},PlayButton:{id:"PlayButton",x:320,y:571.8,w:99.05,h:103.8},InfoText:{id:"InfoText",x:327.85,y:320,w:124.3,h:78.9},Icon:{id:"Icon",x:530,y:260,w:133.25,h:136.6}}}}(resources||(resources={}));var storage;!function(a){function b(a){f=a}function c(a){try{var b=JSON.stringify(a);window.localStorage.setItem(e("State"),""+b)}catch(c){}}function d(){try{var a=window.localStorage.getItem(e("State"));return JSON.parse(a)}catch(b){return null}}function e(a){return f+"."+a}var f="";a.initialize=b,a.save=c,a.load=d }(storage||(storage={}));var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c},sound;!function(a){function b(b){i=b,a.soundManifest=new k(resources.getGameConfig().sound),createjs.Sound.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin]);var c=createjs.Sound.activePlugin,d=c instanceof createjs.WebAudioPlugin,e=createjs.Sound.BrowserDetect,g=e.isIOS||e.isAndroid;a.settings.setSoundFXSupported(d||!g),a.settings.setMusicSupported(!0),a.settings.loadSettings(),Visibility.change(f)}function c(b){a.settings.getMusicSupported()&&m.play(b)}function d(){m.stop()}function e(b){if(b&&a.settings.getSoundFXSupported()&&a.settings.getSoundFX()){var c=b.volume;void 0===c&&(c=1);var d=.7*c;(!b.deferred||respack.isLoaded("sounds"))&&createjs.Sound.play(b.file,createjs.Sound.INTERRUPT_ANY,b.delay,0,0,d)}}function f(a,b){"hidden"==b?g("visibility"):h("visibility")}function g(a){o.mute(a),createjs.Sound.setMute(!0)}function h(a){o.unmute(a),o.isMuted()||createjs.Sound.setMute(!1)}a.soundManifest;var i;a.initialize=b,a.playMusic=c,a.stopMusic=d,a.playSound=e;var j=function(b){function c(){b.apply(this,arguments),this.soundFX=!0,this.music=!0,this.musicSupported=!1,this.soundFXSupported=!1}return __extends(c,b),c.prototype.setSoundFX=function(a){!a!=!this.soundFX&&(this.soundFX=a,this.dispatchEvent("change"),this.saveSettings())},c.prototype.getSoundFX=function(){return this.soundFX},c.prototype.setMusic=function(a){!a!=!this.music&&(this.music=a,this.dispatchEvent("change"),m.enable(a),this.saveSettings())},c.prototype.getMusic=function(){return this.music},c.prototype.setSoundFXSupported=function(a){this.soundFXSupported!=a&&(this.soundFXSupported=a,this.dispatchEvent("change"))},c.prototype.getSoundFXSupported=function(){return this.soundFXSupported},c.prototype.setMusicSupported=function(a){this.musicSupported!=a&&(this.musicSupported=a,this.dispatchEvent("change"))},c.prototype.getMusicSupported=function(){return this.musicSupported},c.prototype.saveSettings=function(){window.localStorage.setItem(i+".SoundFXSetting",a.settings.getSoundFX()?"1":"0"),window.localStorage.setItem(i+".MusicSetting",a.settings.getMusic()?"1":"0")},c.prototype.loadSettings=function(){var a=window.localStorage.getItem(i+".SoundFXSetting"),b=window.localStorage.getItem(i+".MusicSetting");this.soundFX="0"!==a,this.music="0"!==b,m.enable(this.music),this.dispatchEvent("change")},c}(createjs.EventDispatcher);a.SoundSettings=j,a.settings=new j;var k=function(){function a(a){this.primarySoundManifest=[],this.deferredSoundManifest=[];var b=-1!=window.location.search.indexOf("externalSound");this.urlForlderPrefix=b?resources.getGameConfig().global.externalSoundURL:"assets/sound/",this.populateManifestFromDictionary(a)}return a.prototype.populateManifestFromEntry=function(a){a&&(a.file?this.populateManifestFromSoundDef(a):a instanceof Array?this.populateManifestFromArray(a):this.populateManifestFromDictionary(a))},a.prototype.populateManifestFromDictionary=function(a){for(var b in a){var c=a[b];this.populateManifestFromEntry(c)}},a.prototype.populateManifestFromArray=function(a){for(var b=0,c=a.length;c>b;++b){var d=a[b];this.populateManifestFromEntry(d)}},a.prototype.populateManifestFromSoundDef=function(a){if(a&&a.file){var b=a.file,c=a.deferred?this.deferredSoundManifest:this.primarySoundManifest;c.push({id:b,src:this.urlForlderPrefix+b+".ogg",type:createjs.LoadQueue.SOUND})}},a}();a.SoundManifest=k;var l=function(){function a(){this.currentMusicConfig=null,this.musicEnabled=!0,this.musicInstance=null}return a.prototype.play=function(a){this.currentMusicConfig!==a&&(this.stop(),this.currentMusicConfig=a,this.musicEnabled&&this.startCurrentInstance())},a.prototype.stop=function(){this.musicInstance&&(this.musicInstance.stop(),this.musicInstance=null),this.currentMusicConfig=null},a.prototype.enable=function(a){this.musicEnabled!=a&&(a?this.startCurrentInstance():this.stopCurrentInstance(),this.musicEnabled=a)},a.prototype.startCurrentInstance=function(){this.currentMusicConfig&&(this.musicInstance=createjs.Sound.play(this.currentMusicConfig.file,createjs.Sound.INTERRUPT_ANY,0,0,-1,.2))},a.prototype.stopCurrentInstance=function(){this.musicInstance&&(this.musicInstance.stop(),this.musicInstance=null)},a}(),m=new l;a.mute=g,a.unmute=h;var n=function(){function a(){this.count=0,this.inputSet={}}return a.prototype.mute=function(a){this.inputSet[a]||(this.inputSet[a]=!0,this.count++)},a.prototype.unmute=function(a){this.inputSet[a]&&(this.inputSet[a]=!1,this.count--)},a.prototype.isMuted=function(){return this.count>0},a}(),o=new n,p=function(){function a(a){this.soundDefs=a,this.currentIndex=0}return a.prototype.playNextSound=function(){e(this.soundDefs[this.currentIndex]),this.currentIndex++,this.currentIndex>=this.soundDefs.length&&(this.currentIndex=0)},a.prototype.reset=function(){this.currentIndex=0},a}();a.SequentialSoundPicker=p;var q=function(){function a(a){this.soundDefs=a}return a.prototype.playNextSound=function(){e(this.soundDefs[Math.floor(this.soundDefs.length*Math.random())])},a.prototype.reset=function(){},a}();a.RandomSoundPicker=q}(sound||(sound={}));var url;!function(a){var b=function(){function a(a){if(a)for(var b=a.split(/[&\?]/),c=0,d=b.length;d>c;++c){var e=b[c];if(e&&""!=e){var f=e.split("=");this[f[0]]=f[1]?f[1]:!0}}}return a}();a.URLParameters=b}(url||(url={}));var controls;!function(a){function b(b,c,d,e){a.screenWidth=b,a.screenHeight=c,a.gameWidth=d,a.gameHeight=e,a.gameVerticalMargin=(a.screenHeight-a.gameHeight)/2,a.gameplayRectangle=new v(0,(a.screenHeight-a.gameHeight)/2,a.gameWidth,a.gameHeight)}function c(a,b,c){var d=new w(b,function(){c()});return a.addChild(d),d}function d(a){var b=resources.portalConfig.portal&&resources.portalConfig.portal.moreGamesURL;c(a,"MoreGamesButton",f(b))}function e(a){var b=resources.get("sponsor_logo");if(!b)return new createjs.Container;var c=new createjs.Container,d=new createjs.Bitmap(b);d.x=-b.width/2,d.y=-b.height/2,d.hitArea=new createjs.Shape((new createjs.Graphics).beginFill("#f00").drawRect(0,0,b.width,b.height)),d.cursor="pointer",c.addChild(d),c.name="SponsorLogo";var e=resources.portalConfig.portal;return e&&c.addEventListener("click",f(e&&e.logoURL)),a.addChild(c),c}function f(a){return a?"function"==typeof a?a:function(){window.open(resources.portalConfig.portal.logoURL,"_blank")}:function(){}}function g(a,b){var c=new createjs.Sprite(resources.spritesheet);return c.gotoAndStop(b),a.addChild(c),c.name=b,c}function h(b){var c=new createjs.Container;return c.regX=c.x=a.screenWidth/2,c.regY=c.y=a.screenHeight/2,b.addChild(c),c}function i(a,b){for(var c=0,d=a.getNumChildren();d>c;++c){var e=a.getChildAt(c);if(e.name){var f=b[e.name];f&&(e.x=Math.floor(f.x),e.y=Math.floor(f.y))}}}function j(b){var c=new createjs.Sprite(resources.spritesheet,b);return c.scaleX=a.screenWidth/4,c.scaleY=a.screenHeight/4,c.y=-a.gameplayRectangle.y,c}function k(a,b){"undefined"==typeof b&&(b=1);var c=function(){var c=createjs.Ticker.getTime(),d=Math.cos(c/600)+.8;0>d&&(d=0);var e=1+.02*(Math.sin(c/100)+1)*d;a.scaleX=a.scaleY=e*b};a.addEventListener("tick",c)}function l(a,b,c){var d=a.getChildByName(b);d&&(d.alpha=0,d.scaleY=.5,d.scaleX=.5,createjs.Tween.get(d).wait(c).to({alpha:1},300),createjs.Tween.get(d).wait(c).to({scaleX:1,scaleY:1},1500,createjs.Ease.elasticOut))}function m(b){var c=resources.portalConfig.portal;if(c&&c.splash){var d=new createjs.Shape,e=d.graphics;e.beginFill("#230037"),e.drawRect(0,0,a.gameWidth,a.gameHeight),e.endFill(),b.addChild(d);var f=new createjs.Bitmap(resources.get("splash"));b.addChild(f),f.alpha=0,createjs.Tween.get(f).to({alpha:1},300).wait(c.splash.timeMillis).to({alpha:0},500).call(function(){return b.removeChild(f)}),createjs.Tween.get(f).wait(300).call(function(){return b.removeChild(d)})}}function n(b){var c=resources.get(b),d=new createjs.Bitmap(c),e=c.height;return d.y=(a.gameHeight-e)/2,d}function o(b,c){var d=n(b),e=a.gameVerticalMargin-c,f=new createjs.Container;f.addChild(d);var g=new createjs.Shape;g.alpha=.3,g.graphics.beginFill("000000").drawRect(0,0,a.screenWidth,e),g.y=-a.gameVerticalMargin,f.addChild(g);var h=new createjs.Shape;return h.alpha=.3,h.graphics.beginFill("000000").drawRect(0,0,a.screenWidth,e),h.y=a.screenHeight-a.gameVerticalMargin-e,f.addChild(h),f.cache(0,-a.gameVerticalMargin,a.screenWidth,a.screenHeight),f}function p(b,c){var d=new createjs.Shape,e=d.graphics;return e.beginFill(c),e.drawRect(0,-a.gameVerticalMargin,a.screenWidth,a.screenHeight),b.addChild(d),d}function q(a,b,c,d){"undefined"==typeof d&&(d="");var e=new createjs.Text(d,c.style,c.color);return e.name=b,a.addChild(e),e}function r(a,b,c,d){"undefined"==typeof d&&(d=0);var e=new C(d,c);return e.name=b,a&&a.addChild(e),e}function s(a,b,c,d){"undefined"==typeof d&&(d="");var e=new createjs.BitmapText(d,resources.messagesSpritesheet);return e.name=b,e.letterSpacing=-4,e.spaceWidth=9,e.mouseEnabled=!1,a.addChild(e),e}function t(a,b){if(b){var c=a.parent;if(!c)return void b.addChild(a);c.removeChild(a);var d=c.localToGlobal(a.x,a.y),e=b.globalToLocal(d.x,d.y);a.x=e.x,a.y=e.y,b.addChild(a)}}function u(a,b){var c=new D(b);return a.addChild(c),c}a.screenWidth,a.screenHeight,a.gameWidth,a.gameHeight,a.gameVerticalMargin;var v=function(){function a(a,b,c,d){this.x=a,this.y=b,this.width=c,this.height=d}return a.prototype.toLocalY=function(a){return a-this.y},a.prototype.toLocalX=function(a){return a-this.x},a}();a.GameplayRectangle=v,a.gameplayRectangle,a.initialize=b;var w=function(a){function b(b,c){var d=this;a.call(this),this.buttonName=b,this.onClickHandler=c,this.icon=new createjs.Sprite(resources.spritesheet),this.icon.gotoAndStop(b),this.addChild(this.icon),this.mouseChildren=!1,this.name=b,this.cursor="pointer",this.addEventListener("mousedown",function(){return d.handleMouseDown()}),this.addEventListener("click",function(){return d.handleMouseClick()}),this.addEventListener("pressup",function(){return d.handleMouseUp()})}return __extends(b,a),b.prototype.handleMouseDown=function(){createjs.Tween.removeTweens(this.icon),createjs.Tween.get(this.icon).to({scaleX:1.1,scaleY:1.1},300,createjs.Ease.quadIn)},b.prototype.handleMouseUp=function(){createjs.Tween.removeTweens(this.icon),this.icon.scaleX=this.icon.scaleY=1},b.prototype.handleMouseClick=function(){var a=resources.getGameConfig().sound;sound.playSound(a.buttonPressed),this.onClickHandler&&this.onClickHandler()},b.prototype.setAnimation=function(a){this.icon.gotoAndStop(a),this.buttonName=a},b}(createjs.Container);a.IconButton=w;var x=function(){function a(a){this.iconButton=a,this.lockOverlayIcon=new createjs.Sprite(resources.spritesheet),this.lockOverlayIcon.gotoAndStop(a.buttonName);var b=(new createjs.ColorMatrix).adjustSaturation(-255);this.lockOverlayIcon.filters=[new createjs.ColorMatrixFilter(b)];var c=this.lockOverlayIcon.getBounds();this.lockOverlayIcon.cache(c.x,c.y,c.width,c.height),this.iconButton.addChild(this.lockOverlayIcon)}return a.prototype.lock=function(a){this.lockOverlayIcon.visible=a,this.iconButton.icon.visible=!a},a}();a.IconButtonLocker=x;var y=function(a){function b(b,c,d){var e=this;a.call(this),this.buttonNameOn=b,this.buttonNameOff=c,this.onClick=d,this.innerContent=new createjs.Sprite(resources.spritesheet),this.addChild(this.innerContent),this.cursor="pointer",this.setChecked(!1),d&&this.addOnClickHandler(),this.addEventListener("mousedown",function(){return e.handleMouseDown()}),this.addEventListener("pressup",function(){return e.handleMouseUp()}),this.mouseChildren=!1}return __extends(b,a),b.prototype.addOnClickHandler=function(){var a=this;this.addEventListener("click",function(){a.onClick(),a.removeAllEventListeners("click"),setTimeout(function(){return a.addOnClickHandler()},100)})},b.prototype.setChecked=function(a){this.innerContent.gotoAndStop(a?this.buttonNameOn:this.buttonNameOff)},b.prototype.handleMouseDown=function(){createjs.Tween.removeTweens(this.innerContent),createjs.Tween.get(this.innerContent).to({scaleX:1.1,scaleY:1.1},300,createjs.Ease.quadIn)},b.prototype.handleMouseUp=function(){createjs.Tween.removeTweens(this.innerContent),this.innerContent.scaleX=this.innerContent.scaleY=1},b}(createjs.Container);a.CheckIconButton=y,a.createIconButton=c,a.createMoreGamesButton=d,a.createSponsorLogo=e,a.getClickActionFunction=f,a.createStaticImage=g,a.createFullScreenContainer=h,a.readLayout=i,a.getFullScreenWipeImage=j,a.addDefaultButtonAnimation=k,a.bounceButton=l,a.showSplashScreen=m,a.createBackgroundBitmap=n,a.createBackgroundBitmapWithDimmedMargins=o;var z=function(b){function c(a){"undefined"==typeof a&&(a=!0),b.call(this),this.shadowStarsEnabled=a}return __extends(c,b),c.prototype.showStars=function(a){this.initializeStars(a)},c.prototype.animateStars=function(a){this.initializeStars(a);for(var b=0;a>b;++b){var c=this.getChildAt(b);c.scaleX=.1,c.scaleY=.1,c.alpha=0;var d=300*b+300;createjs.Tween.get(c).wait(d).to({scaleX:1,scaleY:1},500,createjs.Ease.backOut),createjs.Tween.get(c).wait(d).to({alpha:1},500,createjs.Ease.linear)}},c.prototype.initializeStars=function(b){this.removeAllChildren(),this.createStar("Star1",b>=1),this.createStar("Star3",b>=3),this.createStar("Star2",b>=2),a.readLayout(this,resources.layout.StarPanel)},c.prototype.createStar=function(a,b){var c=new createjs.Sprite(resources.spritesheet);c.gotoAndStop(b?"StarEnabled":"StarDisabled"),c.name=a,this.addChild(c),c.visible=b||this.shadowStarsEnabled},c}(createjs.Container);a.StarPanel=z;var A=function(b){function c(c,d){var e=this;b.call(this),this.layoutName=c,this.buttons=d,a.createIconButton(this,c+"Background",function(){e.toggle()}),this.buttonContainer=new createjs.Container,this.addChild(this.buttonContainer);for(var f=0,g=d.length;g>f;++f){var h=d[f];this.buttonContainer.addChild(h)}this.buttonContainer.visible=!1,this.buttonContainer.alpha=0,a.readLayout(this,resources.layout[c]),a.readLayout(this.buttonContainer,resources.layout[c]),this.open=!1}return __extends(c,b),c.prototype.toggle=function(){this.open?(this.open=!1,createjs.Tween.get(this.buttonContainer).to({alpha:0},200).set({visible:!1})):(this.open=!0,createjs.Tween.get(this.buttonContainer).to({alpha:1},200),this.buttonContainer.visible=!0)},c}(createjs.Container);a.RotoPanel=A;var B=function(a){function b(b,c,d){var e=this;a.call(this),this.sparkleLabel=b,this.rectangle=d;for(var f=0;c>f;++f){var g=new createjs.Sprite(resources.spritesheet);g.visible=!1,this.addChild(g);var h=function(a){g.addEventListener("animationend",function(){return e.renewParticle(a)})};h(g)}}return __extends(b,a),b.prototype.startParticles=function(){for(var a=0,b=this.getNumChildren();b>a;++a){var c=this.getChildAt(a);c.visible=!1,this.kickParticle(c,300*a)}},b.prototype.kickParticle=function(a,b){var c=this;setTimeout(function(){a.visible=!0,a.gotoAndPlay(c.sparkleLabel)},b),this.renewParticle(a)},b.prototype.renewParticle=function(a){var b=this.rectangle;a.x=b.x+b.width*Math.random(),a.y=b.y+b.height*Math.random()},b}(createjs.Container);a.SparklePanel=B,a.createSolidRect=p,a.createText=q,a.createNumberTextField=r,a.createBitmapText=s;var C=function(a){function b(b,c){a.call(this,""+Math.floor(b),c.style,c.color),this.previousNumberValue=b,this.numberValue=b}return __extends(b,a),b.prototype.draw=function(b,c){return this.numberValue!=this.previousNumberValue&&(this.text=""+Math.floor(this.numberValue),this.previousNumberValue=this.numberValue),a.prototype.draw.call(this,b,c)},b}(createjs.Text);a.NumberTextField=C,a.moveSpriteWithPosition=t,a.createGameShopButton=u;var D=function(b){function c(c){var d=this;b.call(this),this.starText=null,this.starCount=0,this.innerButton=null,this.shopStarCounter=null,this.animated=!1,this.name="MapGameShopButton",this.innerButton=a.createIconButton(this,"MapGameShopButton",c),this.shopStarCounter=a.createStaticImage(this,"ShopStarCounter"),this.shopStarCounter.x=0,this.shopStarCounter.y=45,this.shopStarCounter.scaleX=this.shopStarCounter.scaleY=.7,this.starText=a.createText(this,"StarCount",resources.getGameConfig().powerups.style.gameShopButtonStarCount),this.starText.x=0,this.starText.y=28,this.addEventListener("tick",function(){return d.animate()})}return __extends(c,b),c.prototype.animate=function(){if(!this.animated)return this.shopStarCounter.scaleX=this.shopStarCounter.scaleY=.7,this.innerButton.scaleX=this.innerButton.scaleY=1,void(this.innerButton.rotation=0);var a=createjs.Ticker.getTime(),b=Math.cos(a/600)+1,c=1+.03*(Math.sin(a/50)+1)*b,d=10*Math.sin(a/100);this.innerButton.scaleX=this.innerButton.scaleY=c,this.innerButton.rotation=d},c.prototype.setStarCount=function(a){this.starCount=a,this.refresh()},c.prototype.refresh=function(){this.starText.text=""+this.starCount},c}(createjs.Container);a.GameShopButton=D}(controls||(controls={}));var respack;!function(a){function b(b,c,d){g(b,a.primaryLoadQueue,c,d)}function c(b,c){var d;c?(d=p[c],d||(d=l(),p[c]=d),d.loadManifest(b,!1)):(d=a.primaryLoadQueue,d.loadManifest(b))}function d(a,b){"/"!=a[a.length-1]&&(a+="/");for(var d in b){var e=[],f=n(b[d]),g=f.respack;q[d]=b[d];var h=f.images;if(h){for(var i=0,j=h.length;j>i;i++){var k=h[i];e.push({id:k,src:a+k})}c(e,g)}}}function e(b,c){var d=p[b];return!d||d.loaded?void(c&&c()):void g(a.deferredPreloaderScreen,d,null,c)}function f(a){var b=p[a];return!b||b.loaded}function g(a,b,c,d){a.start(),b.addEventListener("complete",function(){c&&c(),a.requestTermination(function(){d&&d()})}),b.addEventListener("progress",function(b){a.updateProgress(b.progress)})}function h(b,c){var d=k(c);return d?d.getResult(b)||a.primaryLoadQueue.getResult(b):a.primaryLoadQueue.getResult(b)}function i(a,b){var c=r[a];if(c)return c;var d=q[a];if(!d)return null;var e=k(b),c=j(e,d);return r[a]=c,c}function j(a,b){for(var c=b.images,d=0,e=c.length;e>d;d++){var f=c[d];c[d]=a.getResult(f)}return new createjs.SpriteSheet(b)}function k(b){return b?p[b]||null:a.primaryLoadQueue}function l(){var b=new createjs.LoadQueue;return b.installPlugin(createjs.Sound),s&&s.addEventListener("complete",function(){a.debugDefferedPreloadDelay?m(b):b.load()}),s=b,b}function m(b){setTimeout(function(){b.load()},a.debugDefferedPreloadDelay)}function n(a){var b=a.animations;if(!b)return null;for(var c in b)b[c].next=!1;return a}var o=function(){function a(){}return a.prototype.start=function(){},a.prototype.updateProgress=function(){},a.prototype.requestTermination=function(a){a()},a}();a.deferredPreloaderScreen=new o,a.debugDefferedPreloadDelay=0,a.showPrimaryPreloader=b,a.primaryLoadQueue=l();var p={};a.loadManifest=c;var q={},r={};a.loadSpritesheet=d,a.waitFor=e,a.isLoaded=f,a.get=h,a.getSpritesheet=i;var s}(respack||(respack={}));var transitionfx;!function(a){function b(a,b,c){var d=f(c),i=d.out,j=d.in;h=a.autoClear,createjs.onNextTick(function(){e(a,i,function(){b(),g&&(a.removeChild(g),a.addChild(g)),createjs.onNextTick(function(){e(a,j,function(){a.autoClear=h})})})})}function c(a,b,c){g=controls.getFullScreenWipeImage("BlackRect"),g.alpha=.01,a.addChild(g),createjs.onNextTick(function(){createjs.Tween.get(g).to({alpha:1},b.duration,createjs.Ease.quadOut).call(c)})}function d(a,b,c){g&&createjs.Tween.get(g).to({alpha:0},b.duration,createjs.Ease.quadIn).call(function(){g.parent.removeChild(g),g=null,c()})}function e(b,c,d){if(!c)return void d();var e=a[c.type];return e?void e(b,c,d):void d()}function f(a){var b=resources.getGameConfig().transitions,c=b[a]||b.standard;return c}a.start=b;var g=null;a.fadeOut=c,a.fadeIn=d;var h}(transitionfx||(transitionfx={}));var preloader;!function(a){var b={framerate:24,images:["assets/img/preloader.png"],frames:[[0,0,256,128,0,124,15],[256,0,256,128,0,124,16]],animations:{ProgressBar:{frames:[1],speed:1},ProgressBack:{frames:[0],speed:1}}},c=function(a){function c(c){a.call(this),this.parentContainer=c,this.spritesheet=new createjs.SpriteSheet(b),this.title=new createjs.Bitmap("assets/img/title.png"),controls.createSolidRect(this,"#c0edf6")}return __extends(c,a),c.prototype.start=function(){this.parentContainer.addChild(this)},c.prototype.updateProgress=function(a){!this.progress&&this.spritesheet.complete&&(this.title.y=10,this.addChild(this.title),this.progress=new d(this.spritesheet),this.progress.y=100,this.addChild(this.progress)),this.progress&&this.progress.updateRatio(a)},c.prototype.requestTermination=function(a){var b=this,c=controls.createIconButton(this,"PlayButton",function(){sound.playMusic(resources.getGameConfig().sound.musicMenu),transitionfx.start(b.getStage(),function(){var c=b.parent;c.removeChild(b),a()})});createjs.Tween.get(this,{useTicks:!0}).wait(10).call(function(){createjs.Tween.get(c).to({scaleX:.9,scaleY:.9},700,createjs.Ease.backOut),createjs.Tween.get(c).to({alpha:1},700),createjs.Tween.get(b.progress).to({alpha:0},700)}),c.x=320,c.y=450,c.alpha=.01,c.scaleX=c.scaleY=.6},c}(createjs.Container);a.PreloaderScreen=c;var d=function(a){function b(b){a.call(this),this.background=new createjs.Sprite(b),this.background.gotoAndStop("ProgressBack"),this.background.x=controls.gameWidth/2,this.background.y=controls.gameHeight/2,this.addChild(this.background);var c=b.getAnimation("ProgressBar"),d=b.getFrame(c.frames[0]),e=new createjs.Bitmap(d.image);e.sourceRect=d.rect.clone(),e.regX=d.regX,e.regY=d.regY,this.addChild(e),this.progressBitmap=e,this.progressBitmap.x=controls.gameWidth/2,this.progressBitmap.y=controls.gameHeight/2,this.size=e.sourceRect.width}return __extends(b,a),b.prototype.updateRatio=function(a){this.progressBitmap.sourceRect.width=a*this.size},b}(createjs.Container),e=function(a){function b(b){a.call(this),this.parentContainer=b,controls.createSolidRect(this,"#000000");var c=new createjs.Text("Loading...","bold 32px arial, helvetica, sans-serif","#FFFFFF");c.x=320,c.y=450,c.textAlign="center",this.addChild(c)}return __extends(b,a),b.prototype.start=function(){this.parentContainer.addChild(this)},b.prototype.updateProgress=function(){},b.prototype.requestTermination=function(a){var b=this.parent;b.removeChild(this),a()},b}(createjs.Container);a.TextPreloaderScreen=e}(preloader||(preloader={}));var resources;!function(a){function b(b,f){a.savedGame=storage.load(),createjs.Sound.alternateExtensions=["m4a"];respack.primaryLoadQueue;k(),e(),d(),respack.loadManifest(m),spritesheets["comix-jellyquest"].respack="comix",respack.loadSpritesheet("assets/img/spritesheets/",spritesheets),p&&respack.loadManifest(p,"map"),respack.loadManifest(n,"shop"),respack.loadManifest(o,"backs"),respack.loadManifest(sound.soundManifest.primarySoundManifest),respack.loadManifest(sound.soundManifest.deferredSoundManifest,"sound"),respack.showPrimaryPreloader(new preloader.PreloaderScreen(b),c,f),respack.deferredPreloaderScreen=new preloader.TextPreloaderScreen(b)}function c(){a.spritesheet=respack.getSpritesheet("spritesheet-jellyquest");var b=f("messages_spritesheet_json");b.images=[f("messages_spritesheet")],a.messagesSpritesheet=new createjs.SpriteSheet(b),a.textMessages=f("textMessages")}function d(){var a="en";m.push({id:"textMessages",src:"assets/text/messages_"+a+".json"}),m.push({id:"messages_spritesheet",src:"assets/img/messages-jellyquest-"+a+".png"}),m.push({id:"messages_spritesheet_json",src:"assets/img/messages-jellyquest-"+a+".json"})}function e(){var b=a.portalConfig.portal;b&&b.logo&&m.push({id:"sponsor_logo",src:b.logo})}function f(a){return respack.get(a)}function g(){return GLOBAL_GAME_CONFIG}function h(a){return GAME_LEVELS[a]}function i(){return GAME_LEVELS.length}function j(b){return a.textMessages[b]||b}function k(){for(var a=l(),b=a.nextLevel,c=g().backgrounds,d=0,e=c.length;e>d;++d){var f=c[d],h=f.name,i={id:h,src:"assets/img/backs/"+h+".png"};b>=f.fromLevel?(m.push(i),f.deferred=!1):(o.push(i),f.deferred=!0)}var j={id:"map-background",src:"assets/img/map-background.png"};b>1?m.push(j):p=[j]}function l(){var b=a.savedGame,c=new metaModels.PlayerLevelProgress(a.getGameLevelCount());return b&&c.setMemento(b.playerLevelProgress),c}var m=[{id:"full_screen_panel",src:"assets/img/full-screen-panel.png"},{id:"game_title",src:"assets/img/title.png"}],n=[{id:"powerup-shop-background",src:"assets/img/powerup-shop-background.png"}],o=[],p=null;a.spritesheet,a.messagesSpritesheet,a.textMessages,a.portalConfig,a.urlParameters=new url.URLParameters(window.location.search),a.savedGame;a.preloadGameAssets=b,a.get=f,a.getGameConfig=g,a.getGameLevel=h,a.getGameLevelCount=i,a.getMessage=j}(resources||(resources={}));var soundControls;!function(a){function b(a,b){var c=new d;return c.name=b,a.addChild(c),c}function c(a,b){var c=new e;return c.name=b,a.addChild(c),c}a.soundFXOnButtonName="SoundFXButtonOn",a.soundFXOffButtonName="SoundFXButtonOff",a.musicOnButtonName="MusicButtonOn",a.musicOffButtonName="MusicButtonOff";var d=function(b){function c(){var c=this;b.call(this,a.soundFXOnButtonName,a.soundFXOffButtonName,function(){return c.toggleSound()}),sound.settings.addEventListener("change",function(){return c.refreshSoundSettings()}),this.refreshSoundSettings()}return __extends(c,b),c.prototype.toggleSound=function(){sound.settings.setSoundFX(!sound.settings.getSoundFX())},c.prototype.refreshSoundSettings=function(){this.setChecked(sound.settings.getSoundFX()),this.visible=sound.settings.getSoundFXSupported()},c}(controls.CheckIconButton),e=function(b){function c(){var c=this;b.call(this,a.musicOnButtonName,a.musicOffButtonName,function(){return c.toggleSound()}),sound.settings.addEventListener("change",function(){return c.refreshSoundSettings()}),this.refreshSoundSettings()}return __extends(c,b),c.prototype.toggleSound=function(){sound.settings.setMusic(!sound.settings.getMusic())},c.prototype.refreshSoundSettings=function(){this.setChecked(sound.settings.getMusic()),this.visible=sound.settings.getMusicSupported()},c}(controls.CheckIconButton);a.createSoundFXButton=b,a.createMusicButton=c}(soundControls||(soundControls={}));var game;!function(a){function b(a,b){return a.scoreTarget>0?a.score/a.scoreTarget:a.targetCookies>0?a.activatedCookieCount/a.targetCookies:b.initialAggregateFruitCounter?1-b.currentAggregateFruitCounter/b.initialAggregateFruitCounter:a.initialBossHealth?a.bossHealth/a.initialBossHealth:0}function c(a,c,d){var e=new gametracker.LevelStatisticsEntry;return e.isComplete=d,e.completionProgress=b(a,c),e.resourceUsage=a.initialMovesCount?1-a.gameWonOnMovesCount/a.initialMovesCount:0,e.stars=a.starLevels.starsEarned,e.score=a.score,e.time=a.gameTimeMillis,e}var d=function(){function a(a){this.starScoreLevels=a,this.starsEarned=0,this.allStarsEarned=!1,this.currentStarProgress=0,this.currentStarScoreGoal=0,this.lastStarScore=0,this.currentScore=0}return a.fromString=function(b){if(!b)return new a([]);for(var c=b.split(","),d=0,e=c.length;e>d;++d)c[d]=parseInt(c[d],10);return new a(c)},a.prototype.setCurrentScore=function(a){if(this.currentScore!=a&&(this.currentScore=a,!this.allStarsEarned)){for(this.currentStarScoreGoal=this.starScoreLevels[this.starsEarned];a>this.currentStarScoreGoal;){if(this.starsEarned++,this.starsEarned>=this.starScoreLevels.length)return this.allStarsEarned=!0,this.currentStarProgress=0,this.lastStarScore=this.currentStarScoreGoal,void(this.currentStarScoreGoal=0);this.lastStarScore=this.currentStarScoreGoal,this.currentStarScoreGoal=this.starScoreLevels[this.starsEarned]}this.currentStarProgress=(a-this.lastStarScore)/(this.currentStarScoreGoal-this.lastStarScore)}},a}();a.StarLevels=d;var e=function(){function a(){this.gameTimeMillis=0,this.remainingMovesCount=0,this.gameWonOnMovesCount=0,this.initialMovesCount=0,this.score=0,this.scoreTarget=0,this.targetCookies=0,this.activatedCookieCount=0,this.bossHealth=0,this.initialBossHealth=0,this.bonusMovesAvailable=0,this.availableShuffleCount=0}return a}();a.GameProgress=e,a.getGoalProgress=b,a.createLevelStatistics=c}(game||(game={}));var countdown;!function(a){var b=function(){function a(a){this.range=a,this.reset()}return a.prototype.tick=function(){this.remainingTicks<=0&&this.reset(),this.remainingTicks--},a.prototype.reset=function(){this.remainingTicks=this.range.from+Math.floor((this.range.to-this.range.from)*Math.random())},a.prototype.isEllapsed=function(){return 0==this.remainingTicks},a}();a.RepeatableRandomizedCountDown=b;var c=function(){function a(a,b){this.from=a,this.to=b}return a.parse=function(b){var c=b.split("-");if(1==c.length){var d=parseInt(c[0],10)||0;return new a(d,d)}var e=parseInt(c[0],10)||0,f=parseInt(c[1],10)||e;return new a(e,f)},a}();a.NumericRange=c}(countdown||(countdown={}));var uiComponents;!function(a){var b=function(a){function b(){a.apply(this,arguments)}return __extends(b,a),b.prototype.draw=function(a){var b=this.children,c=b.length;if(0!=c){a.save();for(var d=(this._matrix,this.alpha),e=this.getStage(),f=e?e.x+this.x:0,g=e?e.y+this.y:0,h=0;c>h;++h){var i=b[h];if(i.isVisible()){var j=i._matrix.identity().appendTransform(i.x+f,i.y+g,i.scaleX,i.scaleY,i.rotation,i.skewX,i.skewY,i.regX,i.regY);a.setTransform(j.a,j.b,j.c,j.d,j.tx,j.ty),a.globalAlpha=d*i.alpha,i.draw(a)}}return a.restore(),!0}},b}(createjs.Container);a.FastContainer=b;var c=function(a){function b(b){a.call(this);var c=resources.spritesheet.getAnimation(b),d=resources.spritesheet.getFrame(c.frames[0]),e=new createjs.Bitmap(d.image);e.sourceRect=d.rect.clone(),e.regX=d.regX,e.regY=d.regY,this.addChild(e),this.timeProgress=e,this.originalWidth=d.rect.width}return __extends(b,a),b.prototype.setProgress=function(a){0>a&&(a=0),a>1&&(a=1),this.progress=a;var b=Math.floor(this.originalWidth*a);b>0?(this.timeProgress.sourceRect.width=b,this.timeProgress.visible=!0):this.timeProgress.visible=!1},b}(createjs.Container);a.ProgressBarBitmap=c}(uiComponents||(uiComponents={}));var game;!function(a){var b=function(a){function b(){a.apply(this,arguments),this.systems=new Array,this.updateLoopSystems=new Array}return __extends(b,a),b.prototype.start=function(a){this.stop();var b=a.filter(function(a){return a&&a.zOrder});b.sort(function(a,b){return a.zOrder-b.zOrder});for(var c=a.length,d=0;c>d;++d){var e=b[d];if(e){var f=e.system;f instanceof createjs.DisplayObject&&(e.name&&(f.name=e.name),this.addChild(f))}}for(var d=0;c>d;++d){var e=a[d];if(e){var g=e.system;g.onStartSystem&&g.onStartSystem(),g.update&&this.updateLoopSystems.push(g),this.systems.push(g)}}this.resume()},b.prototype.stop=function(){for(var a=0,b=this.systems.length;b>a;++a){var c=this.systems[a];c.onStopSystem&&c.onStopSystem()}this.systems.length=0,this.updateLoopSystems.length=0,this.removeAllEventListeners("tick"),this.removeAllChildren(),this.enabled=!1},b.prototype.update=function(a){for(var b=this.updateLoopSystems,c=0,d=b.length;d>c;++c){var e=b[c];e.update(a)}},b.prototype.endFrame=function(a){for(var b=this.updateLoopSystems,c=0,d=b.length;d>c;++c){var e=b[c];e.endFrame&&e.endFrame(a)}},b.prototype.pause=function(){0!=this.updateLoopSystems.length&&this.enabled&&(this.removeAllEventListeners("tick"),this.enabled=!1)},b.prototype.resume=function(){var a=this;0!=this.updateLoopSystems.length&&!this.enabled&&this.updateLoopSystems.length>0&&(this.removeAllEventListeners("tick"),this.addEventListener("tick",function(b){return a.handleTick(b)}),this.warmupTicksRemaining=5,this.enabled=!0)},b.prototype.handleTick=function(a){if(this.warmupTicksRemaining>0)return void this.warmupTicksRemaining--;var b=a.params[0],c=b.delta;this.update(c),this.endFrame(c),this.onAfterUpdate&&this.onAfterUpdate(c)},b}(uiComponents.FastContainer);a.GameEngine=b}(game||(game={}));var rnd;!function(a){function b(a){if(!a||0==a.length)return null;for(var b=a.length,c=0,d=0;b>d;++d)c+=a[d].probability;var e=Math.random(),f=0;for(d=0;b>d;++d){var g=a[d];if(f+=g.probability,f/c>e)return g}return a[a.length-1]}function c(a,b){if(!a||0==a.length)return null;for(var c=a.length,d=0,e=0;c>e;++e)d+=b[e]||0;var f=Math.random(),g=0;for(e=0;c>e;++e)if(g+=b[e]||0,g/d>f)return a[e];return a[a.length-1]}a.pickRandomObjectWithProbability=b,a.pickRandomObjectWithProbabilityArray=c }(rnd||(rnd={}));var powerups;!function(a){var b=function(){function a(a){this.config=a,this.purchased=!1}return a}();a.Powerup=b;var c=function(){function a(a){this.powerupArray=a,this.powerupDictionary={};for(var b=0,c=this.powerupArray.length;c>b;++b){var d=this.powerupArray[b];this.powerupDictionary[d.config.id]=d}}return a.prototype.getMemento=function(){for(var a={},b=0,c=this.powerupArray.length;c>b;++b){var d=this.powerupArray[b];d.purchased&&(a[d.config.id]=!0)}return a},a.prototype.setMemento=function(a){for(var b=0,c=this.powerupArray.length;c>b;++b){var d=this.powerupArray[b],e=a&&a[d.config.id];d.purchased=!!e}},a.createFromConfig=function(c){for(var d=new Array(c.length),e=0,f=c.length;f>e;++e){var g=c[e];d[e]=new b(g)}return new a(d)},a.prototype.getTotalStarsSpent=function(){for(var a=0,b=0,c=this.powerupArray.length;c>b;++b){var d=this.powerupArray[b];d.purchased&&(a+=d.config.starCost)}return a},a.prototype.canAffordNewPowerup=function(a){for(var b=0,c=this.powerupArray.length;c>b;++b){var d=this.powerupArray[b];if(!d.purchased&&d.config.starCost<=a)return!0}return!1},a.prototype.reset=function(){for(var a=0,b=this.powerupArray.length;b>a;++a){var c=this.powerupArray[a];c.purchased=!1}},a}();a.PowerupList=c}(powerups||(powerups={}));var game;!function(a){!function(a){a.SIZE=2,a.BOX_2x1={probability:10,faceAnimationName:"2x1",animationName:"2x1",rotation:0,cells:[!0,!0,!1,!1],width:2,height:1,bottomEdge:[0,0],eyeCount:2},a.BOX_1x2={probability:10,faceAnimationName:"1x2",animationName:"1x2",rotation:0,cells:[!0,!1,!0,!1],width:1,height:2,bottomEdge:[1],eyeCount:1},a.BOX_1x1={probability:50,faceAnimationName:"1x1",animationName:"1x1",rotation:0,cells:[!0,!1,!1,!1],width:1,height:1,bottomEdge:[0],eyeCount:1},a.BOX_2x2={probability:5,faceAnimationName:"2x1",animationName:"2x2",rotation:0,cells:[!0,!0,!0,!0],width:2,height:2,bottomEdge:[1,1],eyeCount:2},a.LIST=[a.BOX_1x1,a.BOX_2x2]}(a.layouts||(a.layouts={}));var b=(a.layouts,[0,1,2,3,4]),c=[0,1,2,3,4];a.jellyvoices={JellyFace0_2x1:c,JellyFace1_2x1:c,JellyFace1_1x2:b,JellyFace2_2x1:b,JellyFace2_1x2:c,JellyFace3_1x2:b}}(game||(game={}));var game;!function(a){var b=function(){function b(a,b,c){"undefined"==typeof a&&(a=null),"undefined"==typeof b&&(b=-1),"undefined"==typeof c&&(c=0),this.layout=a,this.colorIndex=b,this.count=c}return b.createSpecialsDef=function(c){var d=c.split(":"),e=d[0],f=0,g=0,h=d[1],i=a.layouts["BOX_"+h];switch(e){case"F":f=parseInt(d[2].trim(),10),g=parseInt(d[3].trim(),10);break;case"C":f=-1,g=0}return new b(i,f,g)},b.createSpecialsDefList=function(a){return a.split(",").map(function(a){return b.createSpecialsDef(a.trim())})},b}();a.ShapeDef=b;var c=function(){function a(a){this.dropNextSpecialShapeIn=2,this.shapeDef=null,this.nextSpecialShapeMoveCount=0,this.nextSpecialShape=null,this.normalPicker=null,this.specialPicker=null,this.currentShapeIsSpecial=!1,this.normalPicker=d.create(a),this.specialPicker=e.create(a)}return a.prototype.nextShape=function(){return this.nextSpecialShape&&(this.nextSpecialShapeMoveCount>0&&this.nextSpecialShapeMoveCount--,this.nextSpecialShapeMoveCount<=0)?(this.shapeDef=this.nextSpecialShape,this.nextSpecialShape=null,void(this.currentShapeIsSpecial=!0)):(this.currentShapeIsSpecial=!1,void(this.normalPicker&&(this.normalPicker.nextShape(),this.shapeDef=this.normalPicker.shapeDef)))},a.prototype.requestSpecialShape=function(){this.specialPicker&&!this.currentShapeIsSpecial&&(this.specialPicker.nextShape(),this.nextSpecialShape=this.specialPicker.shapeDef,this.nextSpecialShapeMoveCount=this.dropNextSpecialShapeIn)},a}();a.CompositePicker=c;var d=function(){function c(c){this.shapePickConfig=c,this.shapeDef=new b,this.layouts=[a.layouts.BOX_1x1,a.layouts.BOX_1x2,a.layouts.BOX_2x1,a.layouts.BOX_2x2];var d=c.layouts;this.layoutProbabilities=d.split(",").map(function(a){return parseInt(a,10)}),this.colors=c.colors,this.nextShape()}return c.create=function(a){return a.layout?new c(a):null},c.prototype.nextShape=function(){this.shapeDef.layout=rnd.pickRandomObjectWithProbabilityArray(this.layouts,this.layoutProbabilities),this.shapeDef.colorIndex=parseInt(this.colors.charAt(Math.floor(Math.random()*this.colors.length)),10)},c}();a.ShapePicker=d;var e=function(){function a(){this.currentSpecialIndex=0}return a.create=function(c){if(!c||!c.specials)return null;var d=new a;return d.specialsDef=b.createSpecialsDefList(c.specials),d.specialsInterval=parseInt(c.specialsInterval,10),d.specialsMaxLimit=parseInt(c.specialsMax,10),d.isRandomSequence="yes"==c.specialsRandom,d},a.prototype.nextShape=function(){if(!this.shapeDef){if(this.shapeDef=null,this.movesTillNext>0)return void this.movesTillNext--;if(this.movesTillNext=0,this.isRandomSequence){var a=this.specialsDef[Math.floor(this.specialsDef.length*Math.random())];this.shapeDef=a}else{if(this.currentSpecialIndex>=this.specialsDef.length)return null;this.shapeDef=this.specialsDef[this.currentSpecialIndex],this.currentSpecialIndex++}}},a}();a.SpecialShapePicker=e}(game||(game={}));var game;!function(a){var b=function(){function a(){}return a}();a.PowerupTrigger=b;var c=function(){function a(){}return a.no_messup=0,a.cookie=1,a.fruits=2,a.freeze=3,a}();a.ShapeFeatureType=c;var d=function(){function a(){}return a.createFromConfig=function(b){if(!b.messups)return null;var c=new a;return c},a.prototype.clear=function(){this.pickedMessupType=null},a.prototype.nextMove=function(){this.pickedMessupType=c.no_messup},a.messupCountdowns=[],a}();a.ShapeFeaturePicker=d,function(a){a[a.none=0]="none",a[a.eyes=1]="eyes",a[a.extraMoves=2]="extraMoves",a[a.rowClear=3]="rowClear",a[a.columnClear=4]="columnClear",a[a.bomb=5]="bomb",a[a.colorBomb=6]="colorBomb"}(a.BonusType||(a.BonusType={}));var e=a.BonusType,f=function(){function a(){this.activationEffect=0,this.column=0,this.row=0,this.isCoreLayoutShape=!1,this.layout=null,this.shapeSprite=null,this.colorIndex=0,this.activated=!1,this.fruitsCount=-1,this.nextInChain=null,this.chain=null,this.chainId=0,this.individualShapeScore=0,this.shapeFeature=null,this.bonusType=0}return a.prototype.isCollapsible=function(){return this.colorIndex>=0&&this.fruitsCount<=0},a.prototype.isBonusShape=function(){return 1!=this.bonusType&&0!=this.bonusType},a.ACTIVATION_EFFECT_NORMAL=0,a.ACTIVATION_EFFECT_EXPLOSION_SMALL=1,a}();a.GameShape=f;var g=function(){function a(a,b){this.column=a,this.row=b,this.shape=null,this.blocked=!1}return a}();a.GameCell=g;var h=function(){function a(){}return a.prototype.hasEffectiveBonuses=function(){for(var a=this.firstShape;a;){if(0!=a.bonusType&&1!=a.bonusType)return!0;a=a.nextInChain}return!1},a.prototype.getRandomShape=function(){return this.firstShape},a}();a.Chain=h;var i=function(){function a(){this.state=0,this.gamePaused=!1,this.goalDisplayed=!1,this.availableMoveChain=null,this.noMoves=!1,this.extraMovesBonusEnabled=!1,this.bonusesSuppressed=!1,this.extraShapesSupressed=!1,this.delayTimeoutMillis=0,this.collapseAnimationDuration=0}return a.prototype.requestDelay=function(a){a>this.delayTimeoutMillis&&(this.delayTimeoutMillis=a)},a.prototype.requestShuffle=function(){this.state==a.STATE_AWAITING&&(this.state=a.STATE_SHUFFLE_REQUESTED)},a.STATE_AWAITING=0,a.STATE_ACTIVATING=1,a.STATE_COLLAPSING=2,a.STATE_CHAINING=3,a.STATE_DROPPING=4,a.STATE_LOST=5,a.STATE_WON=6,a.STATE_WON_BONUS_COMPLETE=7,a.STATE_SHUFFLE_REQUESTED=8,a.STATE_SHUFFLING=9,a}();a.GameState=i;var j=function(){function a(a){this.capacity=a,this.length=0,this.innerArray=new Array(a)}return a.prototype.push=function(a){this.innerArray[this.length]=a,this.length++},a.prototype.getElement=function(a){return this.innerArray[a]},a.prototype.clear=function(){this.length=0,this.innerArray.length=0,this.innerArray.length=this.capacity},a}();a.DynamicVector=j;var k=function(){function a(a,b,c){this.row=a,this.column=b,this.radius=c}return a}();a.Explosion=k;var l=function(){function b(a,b){this.columnCount=a,this.rowCount=b,this.cells=null,this.topBlockedCells=null,this.gameShapeList=[],this.initialAggregateFruitCounter=0,this.currentAggregateFruitCounter=0,this.currentCookiesCount=0,this.blockedCellExplosionCount=0,this.cells=new Array(b);for(var c=0;b>c;++c){var d=new Array;this.cells[c]=d;for(var e=0;a>e;++e){var f=new g(e,c);d[e]=f}}this.topBlockedCells=new Array(a);for(var e=0;a>e;++e)this.topBlockedCells[e]=0;var h=a*b;this.chains=new j(h),this.newMessupsQueue=new j(h),this.activatedShapesQueue=new j(h),this.activatedChainsQueue=new j(32),this.newShapesQueue=new j(h),this.collapsedShapesQueue=new j(h),this.scheduledBonusShapes=new j(h),this.bonusShapesQueue=new j(h),this.explosionQueue=new j(h),this.updatedBonusGameShapes=new j(h)}return b.prototype.createBonusGameShape=function(a,b,c,d,e){var g=new f;return g.column=a,g.row=b,g.layout=c,g.colorIndex=d,g.bonusType=e,this.bonusShapesQueue.push(g),g},b.prototype.createGameShape=function(a,b,c,d){var e=new f;return e.column=a,e.row=b,e.layout=c,e.colorIndex=d,this.setGameShapeCurrentPositionToGrid(e),this.gameShapeList.push(e),this.newShapesQueue.push(e),-1==d&&this.currentCookiesCount++,e},b.prototype.readFromLayout=function(c,d){for(var e=this.columnCount,f=this.rowCount,g=0;f>g;++g)for(var h=0;e>h;++h){var i=this.getCell(h,g);if(!i.shape){var j=h+g*e,k=c.charAt(j);if("?"!=k&&" "!=k&&"."!=k&&">"!=k)if("#"!=k){var l,m=0,n=b.FRUIT_COLOR_INDEXES[k];void 0!==n?(l=n,m=35):l=+k,"*"==k&&(l=-1);var o=!1,p=!1;if(e-1>h){var q=j+1,r=c.charAt(q);o=">"==r}if(f-1>g){var s=h+(g+1)*e,t=c.charAt(s);p="."==t}var u;u=o&&p?this.createGameShape(h,g,a.layouts.BOX_2x2,l):o?this.createGameShape(h,g,a.layouts.BOX_2x1,l):p?this.createGameShape(h,g,a.layouts.BOX_1x2,l):this.createGameShape(h,g,a.layouts.BOX_1x1,l),u.fruitsCount=m,u.isCoreLayoutShape=!0}else this.topBlockedCells[h]=g+1}}d&&this.loadSpecialLayoutProperties(d)},b.prototype.loadSpecialLayoutProperties=function(a){var b=a.layoutFruitCount||"",c=b.split(",").map(function(a){return parseInt(a.trim(),10)}),d=this.columnCount,e=this.rowCount,f=0;this.currentAggregateFruitCounter=0;for(var g=0;e>g;++g)for(var h=0;d>h;++h){var i=this.getCell(h,g),j=i.shape;if(j&&j.row==i.row&&j.column==i.column&&j.fruitsCount>0){var k=c[f];k&&(j.fruitsCount=k),this.currentAggregateFruitCounter+=j.fruitsCount,f++}}this.initialAggregateFruitCounter=this.currentAggregateFruitCounter},b.prototype.getCell=function(a,b){var c=this.cells[b];return c?c[a]:null},b.prototype.removeActivatedGameShapes=function(){for(var a=this.gameShapeList,b=a.length,c=0,d=0;b>c;++c){var e=a[c];c!=d&&(a[d]=e);var f=e.activated&&e.fruitsCount<=0;e.activated=!1,f?this.clearGameShapeCurrentPositionOnGrid(e):++d}a.length=d},b.prototype.activateChain=function(a){var b=a.shape;if(b){var c=b.chain;if(c){var d=c.size;this.activatedChainsQueue.push(c);for(var e=c.firstShape;e;)e.activated=!0,this.applyDamageToFruits(e,d),e=e.nextInChain}}},b.prototype.activateCell=function(a,b){"undefined"==typeof b&&(b=1);var c=a.shape;this.activateShape(c,b)},b.prototype.activateShape=function(a,b){"undefined"==typeof b&&(b=1),a&&!a.activated&&(a.activated=!0,this.activatedShapesQueue.push(a),this.applyDamageToFruits(a,b),-1==a.colorIndex&&this.currentCookiesCount--)},b.prototype.applyDamageToFruits=function(a,b){a.fruitsCount>0&&(b>a.fruitsCount&&(b=a.fruitsCount),this.currentAggregateFruitCounter-=b,a.fruitsCount-=b)},b.prototype.explodeRow=function(a,b){this.explosionQueue.push(new k(a.row,a.column,1)),this.explodeArea(a,9e3,1,9e3,b)},b.prototype.explodeColumn=function(a,b){this.explosionQueue.push(new k(a.row,a.column,1)),this.explodeArea(a,1,9e3,9e3,b)},b.prototype.explodeColor=function(a){this.explosionQueue.push(new k(a.column,a.row,1));for(var b=a.colorIndex,c=this.columnCount,d=this.rowCount,e=0;d>e;++e)for(var f=0;c>f;++f){var g=this.getCell(f,e),a=g.shape;a&&a.colorIndex==b&&!a.activated&&this.activateShape(a)}},b.prototype.killNonCoreShapes=function(){for(var a=this.columnCount,b=this.rowCount,c=0;b>c;++c)for(var d=0;a>d;++d){var e=this.getCell(d,c),f=e.shape;!f||f.isCoreLayoutShape||f.isBonusShape()||this.activateShape(f)}},b.prototype.explodeCircle=function(a,b,c){this.explosionQueue.push(new k(a.row,a.column,b)),this.explodeArea(a,b,b,b,c)},b.prototype.explodeArea=function(a,b,c,d,e){var f=!1,g=a.column-b;0>g&&(g=0);var h=a.row-c;0>h&&(h=0);var i=a.column+b;i>=this.columnCount&&(i=this.columnCount-1);var j=a.row+c;j>=this.rowCount&&(j=this.rowCount-1);for(var k=h;j>=k;++k)for(var l=g;i>=l;++l){var a=this.getCell(l,k),m=a.shape;a&&a.blocked&&(f=!0),m&&!m.activated&&-1!=m.colorIndex&&this.activateCell(a,e)}f&&this.blockedCellExplosionCount++},b.prototype.collapseShape=function(a,b){this.clearGameShapeCurrentPositionOnGrid(a),a.row=b,this.setGameShapeCurrentPositionToGrid(a),this.collapsedShapesQueue.push(a)},b.prototype.endFrame=function(){this.activatedShapesQueue.clear(),this.activatedChainsQueue.clear(),this.newShapesQueue.clear(),this.collapsedShapesQueue.clear(),this.newMessupsQueue.clear(),this.explosionQueue.clear(),this.updatedBonusGameShapes.clear(),this.blockedCellExplosionCount=0;for(var a=this.bonusShapesQueue,b=0,c=a.length;c>b;++b){var d=a.getElement(b);this.setGameShapeCurrentPositionToGrid(d),this.gameShapeList.push(d)}this.bonusShapesQueue.clear()},b.prototype.setGameShapeCurrentPositionToGrid=function(b){for(var c=b.column,d=b.row,e=b.layout.cells,f=0,g=a.layouts.SIZE,h=0;g>h;++h)for(var i=0;g>i;++i){var j=e[f];if(j){var k=this.getCell(c+i,d+h);k.shape=b}f++}},b.prototype.clearGameShapeCurrentPositionOnGrid=function(b){for(var c=b.column,d=b.row,e=b.layout.cells,f=0,g=a.layouts.SIZE,h=0;g>h;++h)for(var i=0;g>i;++i){var j=e[f];if(j){var k=this.getCell(c+i,d+h);k.shape=null}f++}},b.FRUIT_COLOR_INDEXES={G:2,Y:4,P:3},b}();a.GameGrid=l;var m=function(){function a(){}return a.STATE_PAUSED=0,a.STATE_AWAITING=1,a.STATE_ENTERED=2,a.STATE_ACCEPTED=3,a.STATE_REJECTED=4,a}();a.TapMove=m;var n=function(){function a(a,b,c,d,e,f){this.column=a,this.row=b,this.x=c,this.y=d,this.left=e,this.top=f}return a}();a.VisualGridCell=n;var o=function(){function a(a,b,c){this.gridVisualRect=a,this.columnCount=b,this.rowCount=c,this.gridCells=new Array,this.cellWidth=a.width/b,this.cellHeight=a.height/c;for(var d=0;c>d;++d){var e=new Array;this.gridCells[d]=e;for(var f=0;b>f;++f){var g=new n(f,d,a.x+f*this.cellWidth+this.cellWidth/2,a.y+d*this.cellHeight+this.cellHeight/2,a.x+f*this.cellWidth,a.y+d*this.cellHeight);e[f]=g}}}return a.prototype.getCell=function(a,b){var c=this.gridCells[b];return c?this.gridCells[b][a]:null},a.prototype.getCellFromPixels=function(a,b){var c=Math.floor((a-this.gridVisualRect.x)/this.cellWidth),d=Math.floor((b-this.gridVisualRect.y)/this.cellHeight);return this.getCell(c,d)},a}();a.VisualGrid=o,function(a){a[a.off=0]="off",a[a.spawned=1]="spawned",a[a.animating=2]="animating"}(a.EffectQueueState||(a.EffectQueueState={}));a.EffectQueueState;!function(a){a[a.spawned=0]="spawned",a[a.animating=1]="animating",a[a.complete=2]="complete"}(a.EffectState||(a.EffectState={}));var p=(a.EffectState,function(){function a(){this.state=0,this.bonusType=0,this.originalShape=null,this.targetCell=null}return a}());a.Effect=p;var q=function(){function a(){this.state=0,this.effects=[],this.bonusTypeCount=6,this.effectsByType=new Array(this.bonusTypeCount);for(var a=0;a0}return a.prototype.pickBonusType=function(){if(!this.isBonusAvailable)return null;var a=this.bonuses;return a[Math.floor(Math.random()*a.length)]},a}();a.BonusPicker=r}(game||(game={}));var game;!function(a){var b=function(){function b(a,b,c){this.gameGrid=a,this.gameProgress=b,this.gameState=c,this.cookieScore=resources.getGameConfig().score.cookieScore,this.singleShapeScore=resources.getGameConfig().score.singleShapeScore}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_ACTIVATING){for(var b=this.gameGrid.activatedChainsQueue,c=0,d=b.length;d>c;++c){var e=b.getElement(c),f=e.size,g=(f-1)*f*15/2;0==g&&(g=5),e.chainScore=g,this.gameProgress.score+=g}for(var h=this.gameGrid.activatedShapesQueue,c=0,d=h.length;d>c;++c){var i=h.getElement(c);i.individualShapeScore=-1==i.colorIndex?this.cookieScore:this.singleShapeScore,this.gameProgress.score+=i.individualShapeScore}}},b}();a.ScoreSystem=b;var c=function(){function b(a,b,c){this.gameProgress=a,this.gameState=b,this.targetState=c}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_AWAITING&&!this.gameState.extraMovesBonusEnabled){var b=this.gameProgress;b.score>=b.scoreTarget&&(this.gameState.state=this.targetState)}},b}();a.ScoreTargetSystem=c;var d=function(){function b(a,b,c,d){this.gameProgress=a,this.gameGrid=b,this.gameState=c,this.targetState=d}return b.prototype.update=function(){this.gameState.state!=a.GameState.STATE_AWAITING||this.gameState.extraMovesBonusEnabled||this.gameGrid.currentAggregateFruitCounter<=0&&this.gameProgress.activatedCookieCount>=this.gameProgress.targetCookies&&(this.gameState.state=this.targetState)},b}();a.CollectiblesTargetSystem=d;var e=function(){function b(a,b,c){this.gameProgress=a,this.powerupTrigger=b,this.gameState=c}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_AWAITING&&!this.gameState.extraMovesBonusEnabled){var b=this.gameProgress;if(b.remainingMovesCount<=0){var c=this.gameProgress.bonusMovesAvailable;c?(this.powerupTrigger.bonusMovesGranted=c,this.gameProgress.remainingMovesCount+=c,this.gameProgress.bonusMovesAvailable=0):this.gameState.state=a.GameState.STATE_LOST}}},b}();a.MovesLimitSystem=e;var f=function(){function b(a,b,c){this.gameProgress=a,this.gameState=b,this.targetState=c}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_AWAITING&&!this.gameState.extraMovesBonusEnabled){var b=this.gameProgress;b.bossHealth<=0&&(this.gameState.state=this.targetState)}},b}();a.BossDeadSystem=f;var g=function(){function b(a,b){this.gameGrid=a,this.gameState=b,this.gameplayConfig=null,this.gameplayConfig=resources.getGameConfig().gameplay,this.gameState.availableMoveChain=null,0==this.gameState.noMoves}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_AWAITING){if(this.gameState.availableMoveChain||this.gameState.noMoves)return;for(var b=this.gameGrid.chains,c=b.length-1;c>=0;--c){var d=b.getElement(c);if(d.size>=this.gameplayConfig.minChain)return void(this.gameState.availableMoveChain=d)}this.gameState.noMoves=!0}else this.gameState.availableMoveChain=null,this.gameState.noMoves=!1},b}();a.MovesCheckSystem=g;var h=function(){function b(a,b,c){this.gameState=a,this.gameProgress=b,this.match3Move=c}return b.prototype.update=function(){if(this.match3Move.state==a.TapMove.STATE_ACCEPTED){var b=this.gameProgress;b.remainingMovesCount--,b.remainingMovesCount<0&&(b.remainingMovesCount=0)}},b}();a.MoveCountSystem=h}(game||(game={}));var game;!function(a){var b=function(){function b(a,b){this.gameState=a,this.gameProgress=b}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_WON){this.gameProgress.gameWonOnMovesCount||(this.gameProgress.gameWonOnMovesCount=this.gameProgress.remainingMovesCount);var b=0;this.gameProgress.remainingMovesCount>0&&(b+=250,this.gameProgress.remainingMovesCount--),this.gameProgress.score+=b,this.gameState.requestDelay(250),0==b&&(this.gameState.state=a.GameState.STATE_WON_BONUS_COMPLETE)}},b}();a.GameWonScoreBonusSystem=b}(game||(game={}));var game;!function(a){var b=function(a){function b(c){var d="undefined"!=typeof c?this.getImageName(c):b.DEFAULT_BACKGROUND_NAME;a.call(this,respack.get(d,"backs")),this.centerBitmap()}return __extends(b,a),b.prototype.setLevel=function(a){var b=this.getImageName(a);this.image=respack.get(b,"backs"),this.centerBitmap()},b.prototype.isLevelDeferred=function(a){for(var b=resources.getGameConfig().backgrounds,c=b.length-1;c>=0;--c){var d=b[c];if(d.fromLevel<=a)return d.deferred}return!1},b.prototype.getImageName=function(a){for(var c=resources.getGameConfig().backgrounds,d=c.length-1;d>=0;--d){var e=c[d];if(e.fromLevel<=a)return e.name}return b.DEFAULT_BACKGROUND_NAME},b.prototype.centerBitmap=function(){this.y=(controls.gameHeight-this.image.height)/2},b.DEFAULT_BACKGROUND_NAME="land",b}(createjs.Bitmap);a.GameBackground=b;var c=function(a){function c(c){a.call(this);var d=new b(c);this.addChild(d);var e=controls.createStaticImage(this,"Footer");e.y=controls.gameHeight+20,this.cache(0,-controls.gameVerticalMargin,controls.screenWidth,controls.screenHeight)}return __extends(c,a),c}(createjs.Container);a.GameBackgroundSystem=c}(game||(game={}));var starUI;!function(a){var b=function(a){function b(b){"undefined"==typeof b&&(b=!0),a.call(this),this.shadowStarsEnabled=b}return __extends(b,a),b.prototype.showStars=function(a){this.initializeStars(a)},b.prototype.animateStars=function(a){this.initializeStars(a);for(var b=0;a>b;++b)this.animateStar(b)},b.prototype.animateStar=function(a){var b=this.getChildAt(a);b.scaleX=.1,b.scaleY=.1,b.alpha=0;var c=300*a+300;createjs.Tween.get(b).wait(c).call(function(){return sound.playSound(resources.getGameConfig().sound.starEarned[a])}),createjs.Tween.get(b).wait(c).to({scaleX:1,scaleY:1},500,createjs.Ease.backOut),createjs.Tween.get(b).wait(c).to({alpha:1},500,createjs.Ease.linear)},b.prototype.initializeStars=function(a){this.removeAllChildren(),this.createStar("Star1",a>=1),this.createStar("Star3",a>=3),this.createStar("Star2",a>=2),controls.readLayout(this,resources.layout.StarPanel)},b.prototype.createStar=function(a,b){var c=new createjs.Sprite(resources.spritesheet);c.gotoAndStop(b?"StarEnabled":"StarDisabled"),c.name=a,this.addChild(c),c.visible=b||this.shadowStarsEnabled},b}(createjs.Container);a.StarPanel=b;var c=function(a){function b(b,c,d){a.call(this),this.starCount=b,this.scale=d;var e=resources.spritesheet.getAnimation("StarEnabled");this.starFrame=resources.spritesheet.getFrame(e.frames[0]),this.starFrameProgressRect=this.starFrame.rect.clone();var f=0;this.stars=new Array(b);for(var g=0;b>g;++g){var h=this.createStar(f,0,d);this.stars[g]=h,f+=c}this.currentStar=0}return __extends(b,a),b.prototype.setProgress=function(a,b){for(var c=this.starFrame.rect;this.currentStara;){var d=this.stars[this.currentStar];d.visible=!1,d.y=0,d.sourceRect=this.starFrame.rect,this.currentStar--}var d=this.stars[this.currentStar];if(d){var e=b*c.height,f=(1-b)*c.height;d.y=f*this.scale,this.starFrameProgressRect.y=c.y+f,this.starFrameProgressRect.height=e,d.sourceRect=this.starFrameProgressRect,d.visible=!0}},b.prototype.createStar=function(a,b,c){var d=new createjs.Sprite(resources.spritesheet,"StarDisabled");d.x=a,d.y=b,d.scaleX=d.scaleY=c,this.addChild(d);var e=new createjs.Bitmap(this.starFrame.image);return e.sourceRect=this.starFrame.rect,e.visible=!1,e.x=a,e.y=b,e.regX=this.starFrame.regX,e.regY=this.starFrame.regY,e.scaleX=e.scaleY=c,this.addChild(e),e},b}(createjs.Container);a.StarProgress=c}(starUI||(starUI={}));var game;!function(a){var b=function(a){function b(b){if(a.call(this),controls.createStaticImage(this,"InGamePanelBack"),b){var c=controls.createStaticImage(this,"ProgressBarBack");c.name="ScoreProgress"}controls.readLayout(this,resources.layout.GameScreen)}return __extends(b,a),b}(createjs.Container);a.GameHUDPanel=b;var c=function(a){function b(b){a.call(this),this.gameProgress=b,this.mouseEnabled=!1,this.score=b.score,this.scoreText=controls.createBitmapText(this,"ScoreText",null,""),this.scoreText.scaleX=this.scoreText.scaleY=.6,this.addChild(this.scoreText),this.updateText(),this.fillSpeed=resources.getGameConfig().hud.gameScoreFillSpeed/1e3}return __extends(b,a),b.prototype.update=function(a){var b=this.gameProgress.score;if(this.score100?10*this.fillSpeed:this.fillSpeed;this.score+=c*a,this.score>b&&(this.score=b),this.updateText()}},b.prototype.updateText=function(){this.scoreText.text="S "+Math.floor(this.score)},b}(createjs.Container);a.GameScoreHUD=c;var d=function(a){function b(b){a.call(this,"G "+b.scoreTarget,resources.messagesSpritesheet),this.gameProgress=b,this.letterSpacing=-4,this.spaceWidth=9,this.mouseEnabled=!1,this.scaleX=this.scaleY=.5}return __extends(b,a),b}(createjs.BitmapText);a.GameScoreGoalHUD=d;var e=function(a){function b(b,c){a.call(this,"",resources.messagesSpritesheet),this.gameGrid=b,this.gameProgress=c,this.currentProgress=-1,this.totalProgress=-1,this.letterSpacing=-4,this.spaceWidth=9,this.mouseEnabled=!1,this.scaleX=this.scaleY=.5}return __extends(b,a),b.prototype.update=function(){var a=this.gameGrid.initialAggregateFruitCounter+this.gameProgress.targetCookies,b=this.gameGrid.initialAggregateFruitCounter-this.gameGrid.currentAggregateFruitCounter+this.gameProgress.activatedCookieCount;(this.currentProgress!=b||this.totalProgress!=a)&&(this.currentProgress=b,this.totalProgress=a,this.text=b+" o "+a)},b}(createjs.BitmapText);a.GameCollectiblesTextProgress=e;var f=function(a){function b(b){a.call(this),this.gameProgress=b,this.progressBar=new uiComponents.ProgressBarBitmap("ProgressBarLine"),this.addChild(this.progressBar),this.fillSpeed=resources.getGameConfig().hud.gameScoreProgressFillSpeed/1e3}return __extends(b,a),b.prototype.onStartSystem=function(){this.score=this.gameProgress.score,this.progressBar.setProgress(this.score/this.gameProgress.scoreTarget)},b.prototype.update=function(a){var b=this.gameProgress.score;this.scoreb&&(this.score=b),this.progressBar.setProgress(this.score/this.gameProgress.scoreTarget))},b.prototype.computeProgress=function(){return this.gameProgress.score/this.gameProgress.scoreTarget},b}(createjs.Container);a.GameScoreProgressHUD=f;var g=function(a){function b(b,c){a.call(this),this.gameProgress=b,this.gameGrid=c,this.progressBar=new uiComponents.ProgressBarBitmap("ProgressBarLine"),this.addChild(this.progressBar);var d=controls.createStaticImage(this,this.getIcon());d.scaleX=d.scaleY=.5,d.x=this.progressBar.originalWidth+5,d.y=10,this.fillSpeed=resources.getGameConfig().hud.collectiblessProgressFillSpeed/1e3}return __extends(b,a),b.prototype.getIcon=function(){var a=this.gameGrid.initialAggregateFruitCounter>0,b=this.gameProgress.targetCookies;return a?b?"HudIconFruitsAndCookies":"HudIconFruits":"HudIconCookies"},b.prototype.onStartSystem=function(){this.progressBar.setProgress(this.computeProgress())},b.prototype.update=function(a){var b=this.computeProgress();if(this.progressBar.progressb&&(c=b),this.progressBar.setProgress(c)}},b.prototype.computeProgress=function(){var a=this.gameProgress.targetCookies?10:0,b=this.gameGrid.initialAggregateFruitCounter+this.gameProgress.targetCookies*a,c=this.gameGrid.initialAggregateFruitCounter-this.gameGrid.currentAggregateFruitCounter+this.gameProgress.activatedCookieCount*a;return c/b},b}(createjs.Container);a.CollectiblesProgressHUD=g;var h=function(a){function b(b){a.call(this),this.gameProgress=b,this.progressBar=new uiComponents.ProgressBarBitmap("ProgressBarLine"),this.addChild(this.progressBar),this.fillSpeed=resources.getGameConfig().hud.collectiblessProgressFillSpeed/1e3,this.progressBar.progress=1;var c=controls.createStaticImage(this,"HudIconBoss");c.scaleX=c.scaleY=.5,c.x=this.progressBar.originalWidth+5,c.y=10}return __extends(b,a),b.prototype.update=function(a){var b=this.computeProgress();if(this.progressBar.progress>b){var c=this.progressBar.progress-this.fillSpeed*a;b>c&&(c=b),this.progressBar.setProgress(c)}},b.prototype.computeProgress=function(){var a=this.gameProgress.initialBossHealth,b=this.gameProgress.bossHealth;return b/a},b}(createjs.Container);a.BossProgressHUD=h;var i=function(b){function c(a,c){b.call(this),this.gameState=a,this.gameProgress=c,this.minMovesBlink=resources.getGameConfig().hud.minMovesBlink,this.currentMovesCount=this.gameProgress.remainingMovesCount,this.mouseEnabled=!1,this.movesText=controls.createBitmapText(this,"movesText",null,"M "+this.currentMovesCount),this.addChild(this.movesText),this.movesText.scaleX=this.movesText.scaleY=.6}return __extends(c,b),c.prototype.update=function(b){this.movesText.visible=this.currentMovesCountc&&(this.currentMovesCount=c)):this.currentMovesCount>c&&(this.currentMovesCount=c),this.movesText.text="M "+Math.floor(this.currentMovesCount))},c}(createjs.Container);a.GameTextMovesHUD=i;var j=function(a){function b(b){var c=this;a.call(this,"PauseButton"),this.levelDef=b,this.onClickHandler=function(){return c.onClick()}}return __extends(b,a),b.prototype.onClick=function(){pause.pauseGame(this.levelDef)},b}(controls.IconButton);a.PauseButtonSystem=j;var k=(function(a){function b(){a.call(this,resources.spritesheet),this.currentTime=0,this.gotoAndStop("ButtonMarker")}return __extends(b,a),b.prototype.update=function(a){this.currentTime+=a,this.scaleX=this.scaleY=1+.1*Math.sin(this.currentTime/200)},b}(createjs.Sprite),function(a){function b(b){a.call(this,3,28,.25),this.gameProgress=b,this.gameScoreFillSpeed=resources.getGameConfig().hud.gameScoreFillSpeed/1e3,this.starLevels=b.starLevels}return __extends(b,a),b.prototype.update=function(a){var b=this.gameProgress.score,c=this.starLevels.currentScore;b>c&&(c+=this.gameScoreFillSpeed*a,c>b&&(c=b),this.starLevels.setCurrentScore(c),this.setProgress(this.starLevels.starsEarned,this.starLevels.currentStarProgress))},b}(starUI.StarProgress));a.StarProgressHUDSystem=k}(game||(game={}));var visualfx;!function(a){function b(a){a.addEventListener("animationend",function(){var b=a.parent;b&&b.removeChild(a)})}var c=function(a){function b(b,c,d){a.call(this,null),this.spritesheet=b,this.clipRect=d,this.setAnimation(c),this.sourceRect=new createjs.Rectangle,d||(this.clipRect=new createjs.Rectangle(0,0,this.frameRect.width,this.frameRect.height)),this.setScroll(0,0),this.enabled=!0}return __extends(b,a),b.prototype.setAnimation=function(a){var b=this.spritesheet.getAnimation(a),c=b.frames[0],d=this.spritesheet.getFrame(c),e=d.rect,f=d.image;this.image=f,this.frameRect=e},b.prototype.setEnabled=function(a){this.enabled=a,this.visible=a&&this.sourceRect.width>0&&this.sourceRect.height>0},b.prototype.setScroll=function(a,b){this.sourceRect.x=this.frameRect.x,this.sourceRect.y=this.frameRect.y,this.sourceRect.width=this.frameRect.width,this.sourceRect.height=this.frameRect.height;var c=this.clipRect,d=0,e=0;bh&&(this.sourceRect.width=h); var i=c.height-e;this.sourceRect.height>i&&(this.sourceRect.height=i),this.visible=this.enabled&&this.sourceRect.width>0&&this.sourceRect.height>0},b}(createjs.Bitmap);a.ScrollSprite=c,a.removeWhenAnimationComplete=b}(visualfx||(visualfx={}));var game;!function(a){function b(a){return a.fruitsCount>0?new k(a):new l(a)}var c=function(c){function e(a,b,d,e){c.call(this),this.tapMove=a,this.grid=b,this.visualGrid=d,this.gameState=e,this.currentEyeChain=0,this.concentrateKillStrategy=new s,this.fireworksKillStrategy=new t,this.simpleKillStrategy=new r,this.currentKillStrategy=this.fireworksKillStrategy,this.shapeFreeFallGravityMultiplier=1e3*Math.sqrt(2/resources.getGameConfig().animation.shapeFreeFallGravityConstant),this.animationConfig=resources.getGameConfig().animation,this.gameplay=resources.getGameConfig().gameplay,this.gameState.collapseAnimationDuration=0}return __extends(e,c),e.prototype.onStartSystem=function(){for(var a=this.grid.newShapesQueue,b=0,c=a.length;c>b;++b){var d=a.getElement(b),e=this.grid.rowCount-d.row,f=150*e+90*Math.random();this.dropNewVisualShape(d,f)}this.grid.endFrame()},e.prototype.onStopSystem=function(){},e.prototype.update=function(b){this.gameState.collapseAnimationDuration-=b,this.grid.explosionQueue.length>0&&(createjs.Tween.removeTweens(this),createjs.Tween.get(this).to({x:10,y:20*Math.random()-10},100,createjs.Ease.quadIn).to({x:0,y:0},800,createjs.Ease.elasticOut));for(var c=this.grid.newShapesQueue,e=0,f=c.length;f>e;++e){var g=c.getElement(e);g.shapeSprite||this.dropNewVisualShape(g)}for(var h=this.grid.bonusShapesQueue,e=0,i=h.length;i>e;++e){var g=h.getElement(e);g.shapeSprite||this.grantBonusVisualShape(g)}for(var e=0,k=this.grid.updatedBonusGameShapes.length;k>e;e++){var g=this.grid.updatedBonusGameShapes.getElement(e),l=g.shapeSprite;g.bonusType?l.replaceMarker(j[g.bonusType]):!g.bonusType&&l.marker&&l.removeMarker()}for(var m=this.grid.activatedChainsQueue,n=this.grid.activatedShapesQueue,e=0,o=m.length;o>e;++e){var p=m.getElement(e);if(this.grid.bonusShapesQueue.length>0){{this.grid.bonusShapesQueue.getElement(0)}this.currentKillStrategy=this.concentrateKillStrategy}else this.currentKillStrategy=p.size>=5?this.fireworksKillStrategy:this.simpleKillStrategy;if(this.tapMove.state==a.TapMove.STATE_ACCEPTED)this.currentKillStrategy.explosionCenterX=this.tapMove.visualCell.x,this.currentKillStrategy.explosionCenterY=this.tapMove.visualCell.y;else{var q=p.getRandomShape(),r=this.visualGrid.getCell(q.column,q.row);this.currentKillStrategy.explosionCenterX=r.x,this.currentKillStrategy.explosionCenterY=r.y}for(var g=p.firstShape;g;)this.activateShape(g),g=g.nextInChain}for(var e=0,s=n.length;s>e;++e){var g=n.getElement(e);this.activateShape(g)}for(var t=this.grid.collapsedShapesQueue,e=0,u=t.length;u>e;++e){var g=t.getElement(e);this.collapseShape(g)}this.tapMove.state==a.TapMove.STATE_REJECTED&&this.rejectMove(),this.gameState.state==a.GameState.STATE_AWAITING&&this.gameState.delayTimeoutMillis<=0?this.animateRandomBlink():d=createjs.Ticker.getTime()},e.prototype.activateShape=function(a){a.fruitsCount<=0?-1==a.colorIndex?this.animateKillCookie(a.shapeSprite):this.animateKill(a.shapeSprite):a.shapeSprite.refresh()},e.prototype.rejectMove=function(){var a=this.tapMove.cell,b=a.shape;if(b){var c=b.shapeSprite;createjs.Tween.get(c).to({x:c.x+15}).to({x:c.x},350,createjs.Ease.backOut),this.gameState.requestDelay(400)}},e.prototype.animateRandomBlink=function(){var a=Math.floor(this.grid.rowCount*Math.random()),b=Math.floor(this.grid.columnCount*Math.random()),c=this.grid.getCell(b,a),d=c&&c.shape;d&&d.shapeSprite&&d.shapeSprite.triggerAnimation()},e.prototype.dropNewVisualShape=function(a,c){"undefined"==typeof c&&(c=0);var d=b(a);this.addChild(d),a.shapeSprite=d;var e=this.visualGrid.getCell(a.column,a.row);d.x=e.left,d.y=-300,this.collapseShape(a,c),a.bonusType&&d.replaceMarker(j[a.bonusType])},e.prototype.grantBonusVisualShape=function(a){this.createNewVisualShapeInPlace(a);this.gameState.requestDelay(700)},e.prototype.createNewVisualShapeInPlace=function(a){var c=b(a);this.addChild(c),a.shapeSprite=c;var d=this.visualGrid.getCell(a.column,a.row);c.x=d.left,c.y=d.top,a.bonusType&&c.replaceMarker(j[a.bonusType])},e.prototype.collapseShape=function(a,b){"undefined"==typeof b&&(b=0);var c=this.visualGrid.getCell(a.column,a.row),d=c.top,e=a.shapeSprite;createjs.Tween.removeTweens(e),e.scaleX=1,e.scaleY=1,e.x=c.left;var f=b>0?b:Math.random()*resources.getGameConfig().animation.individualShapeCollapseDelay;f+=25*Math.random();var g=d-e.y,h=15*Math.sqrt(g);createjs.Tween.get(e).wait(f).to({y:e.y-this.animationConfig.jumpUpDistance},this.animationConfig.jumpUpTime,createjs.Ease.quadOut).to({y:d},h,createjs.Ease.quadIn).to({y:d+this.animationConfig.fallDownPenetrationDistance},this.animationConfig.fallDownPenetrationTime,createjs.Ease.cubicOut).to({y:d},this.animationConfig.fallDownBounceBackTime,createjs.Ease.cubicOut);var i=f+this.animationConfig.jumpUpTime+h;i>this.gameState.collapseAnimationDuration&&(this.gameState.collapseAnimationDuration=i);var j=e.height-this.animationConfig.fallDownPenetrationDistance,k=j/e.height,l=1.1;a.isCollapsible()&&createjs.Tween.get(e).wait(f).to({x:e.x+.2*e.width/2,scaleY:1.2,scaleX:.8},h+this.animationConfig.jumpUpTime,createjs.Ease.quadIn).to({x:e.x+(1-l)*e.width/2,scaleY:k,scaleX:l},this.animationConfig.fallDownPenetrationTime,createjs.Ease.cubicOut).to({x:e.x,scaleY:1,scaleX:1},this.animationConfig.fallDownBounceBackTime,createjs.Ease.cubicOut)},e.prototype.animateKill=function(a){if(a){this.removeChild(a),this.addChild(a),this.currentKillStrategy.kill(a)}},e.prototype.animateKillCookie=function(a){var b=this;if(a){this.removeChild(a),this.addChild(a);var c=this.gameState.extraMovesBonusEnabled?200:600,d=3;a.shakeIntensity=0,createjs.Tween.get(a).to({shakeIntensity:5},c).call(function(){sound.playSound(resources.getGameConfig().sound.cookieRemoved);var c=a.getScaleTweenDef(d);c.y=50,c.alpha=0,createjs.Tween.get(a).to(c,550).call(function(){return b.removeChild(a)})}).addEventListener("change",function(){return a.animateShake()}),this.gameState.requestDelay(c)}},e}(uiComponents.FastContainer);a.GridVisualizationSystem=c;var d=0,e=function(b){function c(a,c){var d=c.faceAnimationName;b.call(this,resources.spritesheet),this.scaleX=this.scaleY=.8,this.animationName="JellyFace"+a+"_"+d,this.gotoAndStop(this.animationName);var e=this.spriteSheet.getAnimation(this.animationName);e.next=null;var f=this.spriteSheet.getFrame(this.currentFrame).rect;this.regX=f.width/2,this.regY=f.height/2}return __extends(c,b),c.prototype.triggerAnimation=function(){if(this.paused&&!(Math.random()>.2)){var b=a.jellyvoices[this.animationName];if(b){var c=2e3;if(createjs.Ticker.getTime()-d>c){var e=b[Math.floor(b.length*Math.random())],f=resources.getGameConfig().sound.blockVoices;this.gotoAndPlay(this.animationName),sound.playSound(f[e]),d=createjs.Ticker.getTime()}}else this.gotoAndPlay(this.animationName)}},c}(createjs.Sprite);a.FaceMarker=e;var f=function(a){function b(){a.call(this,resources.spritesheet),this.gotoAndStop("PlusPowerup"),this.alpha=0,this.scaleX=this.scaleY=0,createjs.Tween.get(this).to({scaleX:1,scaleY:1},1200,createjs.Ease.getElasticOut(1.5,.3)),createjs.Tween.get(this).to({alpha:.9},300)}return __extends(b,a),b.prototype.triggerAnimation=function(){createjs.Tween.hasActiveTweens(this)||(createjs.Tween.get(this).to({scaleX:1.2,scaleY:1.2},200,createjs.Ease.quadOut).to({scaleX:1,scaleY:1},1e3,createjs.Ease.elasticOut),createjs.Tween.get(this).to({alpha:1},200,createjs.Ease.quadOut).to({alpha:.9},1e3,createjs.Ease.elasticOut))},b}(createjs.Sprite);a.ExtraShapePowerupMarker=f;var g=function(a){function b(){a.call(this,resources.spritesheet),this.gotoAndStop("RowClearPowerup"),this.alpha=0,this.scaleX=this.scaleY=0,createjs.Tween.get(this).to({scaleX:1,scaleY:1},1200,createjs.Ease.getElasticOut(1.5,.3)),createjs.Tween.get(this).to({alpha:1},300)}return __extends(b,a),b.prototype.triggerAnimation=function(){createjs.Tween.hasActiveTweens(this)||createjs.Tween.get(this).to({scaleX:1.3},200,createjs.Ease.quadOut).to({scaleX:1},1e3,createjs.Ease.elasticOut)},b}(createjs.Sprite);a.RowClearPowerupMarker=g;var h=function(a){function b(){a.call(this,resources.spritesheet),this.gotoAndStop("ColumnClearPowerup"),this.alpha=0,this.scaleX=this.scaleY=0,createjs.Tween.get(this).to({scaleX:1,scaleY:1},1200,createjs.Ease.getElasticOut(1.5,.3)),createjs.Tween.get(this).to({alpha:1},300)}return __extends(b,a),b.prototype.triggerAnimation=function(){createjs.Tween.hasActiveTweens(this)||createjs.Tween.get(this).to({scaleY:1.3},200,createjs.Ease.quadOut).to({scaleY:1},1e3,createjs.Ease.elasticOut)},b}(createjs.Sprite);a.ColumnClearPowerupMarker=h;var i=function(a){function b(){a.call(this,resources.spritesheet),this.gotoAndStop("BombPowerup"),this.alpha=0,this.scaleX=this.scaleY=0,createjs.Tween.get(this).to({scaleX:1,scaleY:1},1200,createjs.Ease.getElasticOut(1.5,.3)),createjs.Tween.get(this).to({alpha:1},300)}return __extends(b,a),b.prototype.triggerAnimation=function(){createjs.Tween.hasActiveTweens(this)||createjs.Tween.get(this).to({scaleX:1.2,scaleY:1.2},200,createjs.Ease.quadOut).to({scaleX:1,scaleY:1},1e3,createjs.Ease.elasticOut)},b}(createjs.Sprite);a.BombPowerupMarker=i;var j=[null,e,f,g,h,i,i],k=function(a){function b(b){a.call(this),this.shape=b,this.bodySprite=new createjs.Sprite(resources.spritesheet);var c=b.colorIndex,d=b.layout,e="Fruit"+d.animationName+"_"+c;this.bodySprite.gotoAndStop(e);var f=this.bodySprite.getBounds(),g=f.x+f.width-25,h=f.y+f.height-25;this.counterBack=new createjs.Sprite(resources.spritesheet),this.counterBack.gotoAndStop("FruitCounter"),this.counterBack.x=g,this.counterBack.y=h,this.counterText=controls.createNumberTextField(null,"CounterText",resources.getGameConfig().style.fruitCounterText,b.fruitsCount),this.currentCounterValue=b.fruitsCount,this.counterText.textAlign="center",this.counterText.x=0,this.counterText.y=-this.counterText.getMeasuredLineHeight()/2,this.height=61*d.height,this.width=61*d.width}return __extends(b,a),b.prototype.refresh=function(){this.counterText.text=""+this.shape.fruitsCount,this.shape.fruitsCount!=this.currentCounterValue&&(this.currentCounterValue=this.shape.fruitsCount,createjs.Tween.removeTweens(this.counterText),createjs.Tween.get(this.counterText).to({numberValue:this.shape.fruitsCount},500),createjs.Tween.removeTweens(this.counterBack),this.counterBack.scaleX=this.counterBack.scaleY=1,createjs.Tween.get(this.counterBack).to({scaleX:1.2,scaleY:1.2},100,createjs.Ease.quadOut).to({scaleX:1,scaleY:1},700,createjs.Ease.elasticOut))},b.prototype.triggerAnimation=function(){},b.prototype.removeMarker=function(){},b.prototype.replaceMarker=function(){},b.prototype.jump=function(){},b.prototype.getScaleTweenDef=function(a){return{x:this.x-(a-1)*this.width/2,y:this.y-(a-1)*this.height/2,scaleX:a,scaleY:a}},b.prototype.createHighlightScrollSprite=function(){var a=2,b=new visualfx.ScrollSprite(resources.spritesheet,"BigHighlight",new createjs.Rectangle(a,a,this.width-2*a,this.height-2*a));return b.setScroll(0,0),b.x=this.x,b.y=this.y,b},b.prototype.draw=function(a){return this.bodySprite.updateContext(a),this.bodySprite.draw(a),this.counterBack.updateContext(a),this.counterBack.draw(a),this.counterText.updateContext(a),this.counterText.draw(a),!0},b}(createjs.DisplayObject);a.FruitSprite=k;var l=function(a){function b(b){a.call(this),this.shape=b,this.shakeIntensity=0,this.bodySprite=new createjs.Sprite(resources.spritesheet);var c=b.colorIndex,d=b.layout,e=-1==c?"Chocolate"+d.animationName:"Marmalade"+d.animationName+"_"+c;this.bodySprite.gotoAndStop(e),this.bodySprite.rotation=d.rotation,this.height=63*d.height,this.width=63*d.width}return __extends(b,a),b.prototype.draw=function(a){return this.bodySprite.updateContext(a),this.bodySprite.draw(a),this.marker&&(this.marker.updateContext(a),this.marker.draw(a)),!0},b.prototype._tick=function(a){this.marker&&this.marker._tick(a)},b.prototype.animateShake=function(){this.bodySprite.x=Math.random()*this.shakeIntensity*2-1,this.bodySprite.y=Math.random()*this.shakeIntensity*2-1},b.prototype.enableFace=function(){this.replaceMarker(e)},b.prototype.isFaceEnabled=function(){return this.marker},b.prototype.checkMarkersEnabled=function(){return null!=this.marker},b.prototype.replaceMarker=function(a){if(this.marker){if(this.marker instanceof a)return;this.removeMarker()}this.marker=new a(this.shape.colorIndex,this.shape.layout),this.marker.x=this.width/2,this.marker.y=this.height/2},b.prototype.removeMarker=function(){this.marker&&(this.marker=null)},b.prototype.triggerAnimation=function(){this.marker&&this.marker.triggerAnimation()},b.prototype.jump=function(){if(!createjs.Tween.hasActiveTweens(this)&&!createjs.Tween.hasActiveTweens(this.bodySprite)){if(this.parent){var a=this.parent;a.removeChild(this),a.addChild(this)}createjs.Tween.get(this.bodySprite).to({y:-15},100+100*Math.random(),createjs.Ease.quadOut).to({y:0},500,createjs.Ease.bounceOut)}},b.prototype.wave=function(){if(!createjs.Tween.hasActiveTweens(this.bodySprite)){var a=this.parent;a.removeChild(this),a.addChild(this),createjs.Tween.get(this.bodySprite).wait(150*Math.random()).to({y:-15},200,createjs.Ease.quadOut).to({y:0},1500,createjs.Ease.elasticOut)}},b.prototype.getScaleTweenDef=function(a){return{x:this.x-(a-1)*this.width/2,y:this.y-(a-1)*this.height/2,scaleX:a,scaleY:a}},b.prototype.createHighlightScrollSprite=function(){var a=2,b=new visualfx.ScrollSprite(resources.spritesheet,"BigHighlight",new createjs.Rectangle(a,a,this.width-2*a,this.height-2*a));return b.setScroll(0,0),b.x=this.x,b.y=this.y,b},b}(createjs.DisplayObject);a.GameShapeSprite=l;var m=function(){function b(a){this.gameState=a,this.nextMoveConfig=resources.getGameConfig().nextMove,this.timeout=this.nextMoveConfig.firstTimeout}return b.prototype.update=function(b){this.gameState.state!=a.GameState.STATE_AWAITING?this.timeout=this.nextMoveConfig.firstTimeout:(this.timeout-=b,this.timeout<=0&&this.gameState.availableMoveChain&&(this.timeout=this.nextMoveConfig.nextTimeout,this.showHint(this.gameState.availableMoveChain)))},b.prototype.showHint=function(a){for(var b=a.firstShape;b;)b.shapeSprite&&b.shapeSprite.jump(),b=b.nextInChain},b}();a.NextMoveVisualizationSystem=m;var n=function(a){function b(b,c,d){a.call(this),this.gameState=b,this.grid=c,this.effectQueue=d,this.goalCollectionTarget={x:resources.layout.GameScreen.GoalCollectionTarget.x,y:resources.layout.GameScreen.GoalCollectionTarget.y},this.movesCollectionTarget={x:resources.layout.GameScreen.MovesCollectionTarget.x,y:resources.layout.GameScreen.MovesCollectionTarget.y}}return __extends(b,a),b.prototype.update=function(){if(1==this.effectQueue.state)for(var a=this.effectQueue.getEffects(2),b=0,c=a.length;c>b;b++){var d=a[b];0==d.state&&(this.collectBonusShape(d.originalShape),d.state=1)}},b.prototype.collectBonusShape=function(a){var b=this.createCollectibleSprite("PlusPowerup",a);this.animateExtraMovements(b,this.movesCollectionTarget)},b.prototype.createCollectibleSprite=function(a,b){var c=new createjs.Sprite(resources.spritesheet);return c.gotoAndStop(a),c.x=b.shapeSprite.x+b.shapeSprite.width/2,c.y=b.shapeSprite.y+b.shapeSprite.height/2,this.addChild(c),c},b.prototype.animateExtraMovements=function(a,b){var c=this;createjs.Tween.get(a).to({scaleX:1.5,scaleY:1.5},700,createjs.Ease.linear),createjs.Tween.get(a).to({x:b.x},700,createjs.Ease.backOut),createjs.Tween.get(a).to({y:b.y},700,createjs.Ease.quadIn).call(function(){c.removeChild(a)}),sound.playSound(resources.getGameConfig().sound.bonusmoves),this.gameState.requestDelay(700)},b}(uiComponents.FastContainer);a.CollectEffectVisualizationSystem=n;var o=function(a){function b(b,c,d){a.call(this),this.gameState=b,this.visualGrid=c,this.effectQueue=d}return __extends(b,a),b.prototype.update=function(){1==this.effectQueue.state&&(this.makeExplosionForBonusType(4),this.makeExplosionForBonusType(3),this.makeExplosionForBonusType(5))},b.prototype.makeExplosionForBonusType=function(a){for(var b=this.effectQueue.getEffects(a),c=0,d=b.length;d>c;++c){var e=b[c];0==e.state&&(e.state=1,this.makeExplosion(e))}},b.prototype.makeExplosion=function(a){var b=this,c=a.originalShape.shapeSprite,d=c.marker;this.addChild(d),d.x+=c.x,d.y+=c.y;var e=a.targetCell,f=this.visualGrid.getCell(e.column,e.row);createjs.Tween.get(d).to({x:f.x,y:f.y},650,createjs.Ease.quadOut).call(function(){sound.playSound(resources.getGameConfig().sound.explosion),b.makeExplosionAtCell(f),b.removeChild(d)}).addEventListener("change",function(){d.visible=Math.floor(createjs.Ticker.getTime()/100)%2!=0}),this.gameState.requestDelay(650)},b.prototype.makeExplosionAtCell=function(a){var b=new createjs.Sprite(resources.spritesheet);b.gotoAndPlay("Explosion"),b.x=a.x,b.y=a.y,b.scaleX=b.scaleY=2.5,visualfx.removeWhenAnimationComplete(b),this.addChild(b)},b}(uiComponents.FastContainer);a.ExplosiveEffectSystem=o;var p=function(a){function b(b){a.call(this,resources.spritesheet,"Highlight",new createjs.Rectangle(0,0,b.width,b.height)),this.x=b.x,this.y=b.y,this.compositeOperation="lighter"}return __extends(b,a),b.prototype.animate=function(a){var b=164,c=1-a,d=-b+c*(this.clipRect.height+2*b);this.setScroll(0,d)},b}(visualfx.ScrollSprite),q=(function(a){function b(b){a.call(this,resources.spritesheet);var c=b.shapeDef,d="Marmalade"+c.layout.animationName+"_W";this.gotoAndStop(d),this.x=b.x,this.y=b.y,this.compositeOperation="lighter",this.shapeRelativeY=c.row/10}return __extends(b,a),b.prototype.animate=function(a){var b=.6,c=1-a,d=-b+c*(1+2*b),e=(d-this.shapeRelativeY)/b,f=4*(.25-e*e);0>f&&(f=0),this.alpha=f},b}(createjs.Sprite),function(b){function c(a,c,d,e){b.call(this),this.grid=a,this.visualGrid=c,this.gameState=d,this.gameplayConfig=e,this.currentTimeout=0,this.nextMoveConfig=resources.getGameConfig().highlight,this.currentTimeout=this.nextMoveConfig.firstTimeout}return __extends(c,b),c.prototype.update=function(b){if(!(this.gameState.collapseAnimationDuration>0)){if(this.gameState.state!=a.GameState.STATE_AWAITING)return this.currentTimeout=this.nextMoveConfig.firstTimeout,void this.removeAllChildren();if(this.currentTimeout>0&&(this.currentTimeout-=b,this.currentTimeout<=0&&(this.kickOutHighlightWave(),this.currentTimeout=this.nextMoveConfig.nextTimeout)),this.getNumChildren()>0)if(this.wavePosition>=1)this.removeAllChildren();else{for(var c=0,d=this.getNumChildren();d>c;++c){var e=this.getChildAt(c);e.animate(this.wavePosition)}this.wavePosition+=.025}}},c.prototype.kickOutHighlightWave=function(){for(var a=this.grid.chains,b=this.gameplayConfig.minBonusChain,c=0,d=a.length;d>c;c++){var e=a.getElement(c);if(e.size>=b&&!e.hasEffectiveBonuses())for(var f=e.firstShape;f;){var g=f.shapeSprite,h=new p(g);this.addChild(h),f=f.nextInChain}}this.wavePosition=0},c}(createjs.Container));a.ShapeHighlightsSystem=q;var r=function(){function a(){}return a.prototype.kill=function(a){createjs.Tween.get(a).to({y:a.y-50-50*Math.random(),alpha:0},250,createjs.Ease.quadOut).call(function(){return a.parent&&a.parent.removeChild(a)}),createjs.Tween.get(a).to({alpha:0},250,createjs.Ease.quadOut)},a}(),s=function(){function a(){}return a.prototype.kill=function(a){(this.explosionCenterX-a.x)/320,(this.explosionCenterY-a.y)/320;createjs.Tween.get(a).to({x:this.explosionCenterX,y:this.explosionCenterY,scaleX:.5,scaleY:.5},250,createjs.Ease.quadIn).call(function(){return a.parent&&a.parent.removeChild(a)})},a}(),t=function(){function a(){}return a.prototype.kill=function(a){var b=a.x-this.explosionCenterX,c=-160,d=400*(1+.2*Math.random()),e=Math.sqrt(b*b+c*c)/d,f=b/e,g=c/e,h=b/5*(1+.2*Math.random());createjs.Tween.get(a).to({x:a.x+f,rotation:h},350,createjs.Ease.linear).call(function(){return a.parent&&a.parent.removeChild(a)}),createjs.Tween.get(a).to({y:a.y+g,scaleX:1.3,scaleY:1.3},350,createjs.Ease.quadOut),createjs.Tween.get(a).wait(100).to({alpha:0},250,createjs.Ease.quadOut)},a}()}(game||(game={}));var game;!function(a){var b=function(){function a(a){this.grid=a,this.currentCollapseRow=0,this.currentCollapseColumn=0,this.lastCollapsedGameShape=null}return a.prototype.start=function(){this.currentCollapseColumn=0,this.currentCollapseRow=this.grid.rowCount-1},a.prototype.next=function(){for(var a=this.grid,b=a.columnCount,c=!1;this.currentCollapseRow>=0;){for(;this.currentCollapseColumn0?(c.collapseShape(a,a.row+b),!0):!1},a.prototype.getFallDepth=function(a){for(var b=a.column,c=a.row,d=a.layout.bottomEdge,e=this.grid,f=e.rowCount,g=0,h=d.length;h>g;++g){for(var i,j=b+g,k=c+d[g]+1,l=0;(i=e.getCell(j,k))&&!i.shape&&!i.blocked;)l++,k++;f>l&&(f=l)}return f},a}();a.CollapseStrategy=b}(game||(game={}));var game;!function(a){var b=function(){function b(a){this.grid=a}return b.prototype.start=function(){this.grid.chains.clear();for(var a=this.grid.gameShapeList,b=0,c=a.length;c>b;++b){var d=a[b];d.chainId=b,d.nextInChain=null,d.chain=null}},b.prototype.next=function(){for(var a=!1,b=this.grid,c=b.columnCount,d=b.rowCount,e=0;d>e;++e)for(var f=0;c>f;++f){var g=b.getCell(f,e),h=g.shape;if(h&&-1!=h.colorIndex){var i=b.getCell(f+1,e);if(i){var j=i.shape;j&&j!=h&&j.colorIndex==h.colorIndex&&(h.chainIdj.chainId&&(h.chainId=j.chainId,a=!0))}var k=b.getCell(f,e+1);if(k){var l=k.shape;l&&l!=h&&l.colorIndex==h.colorIndex&&(h.chainIdl.chainId&&(h.chainId=l.chainId,a=!0))}}}return a||this.linkChainObjects(),a},b.prototype.linkChainObjects=function(){var b=this.grid,c=b.columnCount,d=b.rowCount;b.chains.clear();for(var e=[],f=0;d>f;++f)for(var g=0;c>g;++g){var h=b.getCell(g,f),i=h.shape;if(i){var j=e[i.chainId];j?i.chain||(i.nextInChain=j.firstShape,i.chain=j,j.size++,j.firstShape=i):(j=new a.Chain,j.firstShape=i,i.chain=j,j.size=1,e[i.chainId]=j,this.grid.chains.push(j))}}},b}();a.ChainFinder=b}(game||(game={}));var game;!function(a){function b(b,d){if(c(b,1e5,d),0==a.candidateCount)return null;var e=Math.floor(a.candidateCount*Math.random());return c(b,e,d)}function c(b,c,e){a.candidateCount=0;for(var f=b.columnCount,g=0;f>g;++g){var h=b.topBlockedCells[g],i=b.getCell(g,h),j=d(b,i,e);if(j){if(a.candidateCount>=c)return i;a.candidateCount++}}return null}function d(b,c,d){if(c.column+d.width>b.columnCount)return!1;for(var e=c.column,f=c.row,g=d.cells,h=a.layouts.SIZE,i=d.width,j=d.height,k=0;j>k;++k)for(var l=0;i>l;++l){var m=k*h+l,n=g[m];if(n){var o=b.getCell(e+l,f+k);if(o.shape||o.blocked)return!1}}return!0}a.pickRandomDropCell=b,a.candidateCount,a.pickDropCellByColumn=c}(game||(game={}));var game;!function(a){var b=function(){function a(a){this.grid=a,this.minEyeGroupSize=2}return a.prototype.start=function(){this.chainIndex=0,this.chains=this.grid.chains},a.prototype.next=function(){if(this.chainIndex>=this.chains.length)return!1;var a=this.chains.getElement(this.chainIndex),b=a.size,c=b>=this.minEyeGroupSize;return c?this.showEyes(a):this.hideEyes(a),this.chainIndex++,!0},a.prototype.hideEyes=function(a){for(var b=a.firstShape,c=0;b;)1==b.bonusType&&(b.bonusType=0,this.grid.updatedBonusGameShapes.push(b)),b=b.nextInChain,c++},a.prototype.showEyes=function(a){for(var b=-1,c=a.firstShape,d=0;c;){var e=!c.bonusType||1==c.bonusType;e&&(1==c.bonusType&&(b=d),d++),c=c.nextInChain}0>b&&(b=Math.floor(Math.random()*d));for(var c=a.firstShape,d=0;c;){var e=!c.bonusType||1==c.bonusType;e&&(d==b?1!=c.bonusType&&(c.bonusType=1,this.grid.updatedBonusGameShapes.push(c)):1==c.bonusType&&(c.bonusType=0,this.grid.updatedBonusGameShapes.push(c)),d++),c=c.nextInChain}},a}();a.EyeAllocator=b;var c=function(){function a(a,b,c){this.gameGrid=a,this.bonuses=b,this.fruitDamage=c.explosionFruitDamage,this.bombExplosionRadius=c.bombExplosionRadius}return a.prototype.activateEffects=function(){for(var a=!1,b=this.bonuses.getEffects(3),c=0,d=b.length;d>c;++c){var e=b[c];1==e.state&&(this.gameGrid.explodeRow(e.targetCell,this.fruitDamage),e.state=2),a=!0}for(var b=this.bonuses.getEffects(4),c=0,d=b.length;d>c;++c){var e=b[c];1==e.state&&(this.gameGrid.explodeColumn(e.targetCell,this.fruitDamage),e.state=2),a=!0}for(var b=this.bonuses.getEffects(5),c=0,d=b.length;d>c;++c){var e=b[c];1==e.state&&(this.gameGrid.explodeCircle(e.targetCell,this.bombExplosionRadius,this.fruitDamage),e.state=2),a=!0}return a},a}();a.ExplosiveBonusActivator=c}(game||(game={}));var game;!function(a){var b=function(){function b(b,c,d,e,f,g,h){this.gameState=c,this.gameGrid=d,this.tapMove=e,this.effectQueue=f,this.gameplayConfig=g,this.bonusPicker=h,this.shapePicker=new a.CompositePicker(b),this.shapePicker.nextShape(),this.collapseStrategy=new a.CollapseStrategy(d),this.chainsFinder=new a.ChainFinder(d),this.eyeAllocator=new a.EyeAllocator(d),this.explosiveBonusActivator=new a.ExplosiveBonusActivator(this.gameGrid,this.effectQueue,g),this.specialMax=parseInt(b.specialsMax,10)}return b.prototype.onStartSystem=function(){var b,c=[];if(this.shapePicker.shapeDef){for(;;){var d=this.shapePicker.shapeDef,b=a.pickRandomDropCell(this.gameGrid,d.layout);if(!b)break;var e=this.gameGrid.createGameShape(b.column,b.row,d.layout,d.colorIndex);this.collapseStrategy.tryMoveDown(e),this.shapePicker.nextShape(),c.push(e)}this.makeRandomBonuses(c),this.toCollapsingState()}},b.prototype.makeRandomBonuses=function(a){if(this.bonusPicker.isBonusAvailable)for(var b=this.gameplayConfig.initialPowerupDrop;b>0&&a.length>0;){var c=Math.floor(a.length*Math.random()),d=a[c];d.bonusType=this.bonusPicker.pickBonusType(),a.splice(c,1),b--}},b.prototype.onStopSystem=function(){},b.prototype.update=function(b){if(this.gameState.delayTimeoutMillis>0){if(this.gameState.delayTimeoutMillis-=b,!(this.gameState.delayTimeoutMillis<0))return;this.gameState.delayTimeoutMillis=0}if(this.gameState.state==a.GameState.STATE_AWAITING&&this.tapMove.state==a.TapMove.STATE_ENTERED&&!this.gameState.extraMovesBonusEnabled){var c=this.tapMove.cell,d=c.shape;if(d){var e=d.chain,f=e.size>=this.gameplayConfig.minChain;return void(f?(this.tapMove.state=a.TapMove.STATE_ACCEPTED,this.gameState.state=a.GameState.STATE_ACTIVATING,this.gameGrid.activateChain(c),this.gameGrid.currentCookiesCountd;++d){var e=this.gameGrid.getCell(d,b),f=e.shape;f&&-1==f.colorIndex&&(this.gameGrid.activateShape(f),c=!0)}return c},b.prototype.grantScheduledBonuses=function(){for(var a=this.gameGrid.scheduledBonusShapes,b=0,c=a.length;c>b;++b){a.getElement(b)}a.clear()},b.prototype.endFrame=function(){var b=this.gameState.state==a.GameState.STATE_AWAITING;b&&this.gameState.delayTimeoutMillis<=0?(this.tapMove.state=a.TapMove.STATE_AWAITING,this.tapMove.cell=null,this.tapMove.visualCell=null):this.tapMove.state=a.TapMove.STATE_PAUSED,(this.gameState.state==a.GameState.STATE_ACTIVATING||this.gameState.state==a.GameState.STATE_SHUFFLING)&&this.gameGrid.removeActivatedGameShapes(),this.gameGrid.endFrame()},b}();a.MechanicsSystem=b;var c=function(){function a(a){this.colorIndexArray=a.colors}return a.prototype.pickRandomColor=function(){return this.colorIndexArray[Math.floor(this.colorIndexArray.length*Math.random())]},a}();a.ColorPicker=c}(game||(game={}));var game;!function(a){var b=function(){function a(a){this.target=a,this.events={}}return a.prototype.addEventListener=function(a,b){this.target.addEventListener(a,b),this.events[a]=b},a.prototype.removeAllEventListeners=function(){for(var a in this.events){var b=this.events[a];this.target.removeEventListener(a,b)}},a}(),c=function(){function c(a,c,d,e,f){this.stage=a,this.tapMove=c,this.grid=d,this.visualGrid=e,this.gameState=f,this.eventProxy=new b(a)}return c.prototype.onStartSystem=function(){var a=this;this.eventProxy.addEventListener("stagemousedown",function(b){return a.mouseDown(b)}),this.eventProxy.addEventListener("stagemouseup",function(b){return a.mouseUp(b)})},c.prototype.onStopSystem=function(){this.eventProxy.removeAllEventListeners()},c.prototype.mouseDown=function(a){var b=a.stageX-this.stage.x,c=a.stageY-this.stage.y;this.selectedVisualCell=this.visualGrid.getCellFromPixels(b,c)},c.prototype.mouseUp=function(b){var c=b.stageX-this.stage.x,d=b.stageY-this.stage.y,e=this.visualGrid.getCellFromPixels(c,d);e&&this.selectedVisualCell==e?(this.tapMove.visualCell=e,this.tapMove.cell=this.grid.getCell(e.column,e.row),this.tapMove.state=a.TapMove.STATE_ENTERED):(this.tapMove.state=a.TapMove.STATE_AWAITING,this.tapMove.cell=null,this.tapMove.visualCell=null)},c.prototype.endFrame=function(){},c}();a.PlayerMoveSystem=c}(game||(game={}));var game;!function(a){var b=function(a){function b(b,c,d,e){a.call(this),this.tapMove=b,this.gameState=c,this.grid=d,this.visualGrid=e}return __extends(b,a),b.prototype.update=function(){for(var a=this.grid.activatedChainsQueue,b=0,c=a.length;c>b;++b){var d=a.getElement(b),e=d.chainScore;if(e){var f=d.firstShape;if(f){var g=this.tapMove.cell&&this.tapMove.cell.shape;g&&g.chain==d&&(f=g);var h=f.shapeSprite,i=150*Math.random();this.createFloatyScore(e,h.x,h.y+35*Math.random(),i)}}}for(var j=this.grid.activatedShapesQueue,b=0,c=j.length;c>b;++b){var f=j.getElement(b),e=f.individualShapeScore;if(e){var h=f.shapeSprite,i=-1==f.colorIndex?600:0;this.createFloatyScore(e,h.x,h.y+35*Math.random(),i)}}a.length>5&&!this.gameState.extraMovesBonusEnabled&&this.gameState.requestDelay(500)},b.prototype.createFloatyScore=function(a,b,c,d){var e=this,f=10,g=controls.createBitmapText(this,null,null,"+"+a);g.x=b,g.y=c,this.addChild(g),g.xh&&(g.x=h),g.y<200&&(g.y=200),g.alpha=0,createjs.Tween.get(g).wait(d).to({y:g.y-120},1200,createjs.Ease.circOut),createjs.Tween.get(g).wait(d).to({alpha:1},30).wait(1100).to({alpha:0},100).call(function(){return e.removeChild(g) })},b}(uiComponents.FastContainer);a.FloatingScoresSystem=b;var c=function(b){function c(a){b.call(this),this.gameState=a;var c=new createjs.Sprite(resources.messagesSpritesheet);c.gotoAndStop("GameOverMessage"),c.x=320,c.y=320,this.gameOverMessage=c;var d=new createjs.Sprite(resources.messagesSpritesheet);d.gotoAndStop("LevelCompleteMessage"),d.x=320,d.y=320,this.levelCompleteMessage=d}return __extends(c,b),c.prototype.onStartSystem=function(){},c.prototype.onStopSystem=function(){this.removeAllChildren(),this.messageDisplayed=!1},c.prototype.update=function(){this.gameState.state!=a.GameState.STATE_WON||this.messageDisplayed?this.gameState.state==a.GameState.STATE_WON_BONUS_COMPLETE&&this.messageDisplayed?this.hideLevelCompleteMessage():this.gameState.state!=a.GameState.STATE_LOST||this.messageDisplayed||(this.showGameOverMessage(),this.messageDisplayed=!0,sound.stopMusic()):(this.showLevelCompleteMessage(),this.messageDisplayed=!0,sound.stopMusic())},c.prototype.showLevelCompleteMessage=function(){var a=this;createjs.onNextTick(function(){a.addChild(a.levelCompleteMessage),a.levelCompleteMessage.scaleX=0,a.levelCompleteMessage.scaleY=0,a.levelCompleteMessage.alpha=1,createjs.Tween.get(a.levelCompleteMessage).to({scaleX:1,scaleY:1},1500,createjs.Ease.elasticOut)}),this.gameState.requestDelay(2500)},c.prototype.hideLevelCompleteMessage=function(){var a=this;createjs.onNextTick(function(){createjs.Tween.get(a.levelCompleteMessage).to({alpha:0,scaleX:2,scaleY:2},300,createjs.Ease.quadOut).call(function(){return a.removeChild(a.levelCompleteMessage)})})},c.prototype.showGameOverMessage=function(){var a=this;createjs.onNextTick(function(){a.addChild(a.gameOverMessage),a.gameOverMessage.scaleX=0,a.gameOverMessage.scaleY=0,createjs.Tween.get(a.gameOverMessage).to({scaleX:1,scaleY:1},1e3)}),this.gameState.requestDelay(1700)},c}(createjs.Container);a.GameOverMessageSystem=c;var d=function(a){function b(b){a.call(this),this.powerupTrigger=b;var c=new createjs.Sprite(resources.messagesSpritesheet);c.x=320,c.y=320,this.powerupMessage=c}return __extends(b,a),b.prototype.update=function(){var a=this.powerupTrigger.triggeredPowerup;a&&this.showPowerupMessage(a.config.activationMessageAnimation),this.powerupTrigger.bonusMovesGranted&&(this.showPowerupMessage("BonusMovesMessage"),this.powerupTrigger.bonusMovesGranted=0,sound.playSound(resources.getGameConfig().sound.bonusmoves))},b.prototype.showPowerupMessage=function(a){var b=this;createjs.Tween.removeTweens(this.powerupMessage),this.powerupMessage.parent&&this.removeChild(this.powerupMessage),this.powerupMessage.gotoAndStop(a),this.addChild(this.powerupMessage),this.powerupMessage.scaleX=0,this.powerupMessage.scaleY=0,this.powerupMessage.alpha=0,createjs.Tween.get(this.powerupMessage).to({scaleX:1,scaleY:1,alpha:1},1500,createjs.Ease.elasticOut).wait(500).to({alpha:0,scaleX:2,scaleY:2},300,createjs.Ease.quadOut).call(function(){return b.removeChild(b.powerupMessage)})},b}(createjs.Container);a.PowerupActivationMessageSystem=d}(game||(game={}));var game;!function(a){var b=function(){function b(a){this.move=a,this.soundConfig=resources.getGameConfig().sound,this.rejectSoundPicker=new sound.RandomSoundPicker(this.soundConfig.moveRejected),this.acceptSoundPicker=new sound.SequentialSoundPicker(this.soundConfig.moveAccepted)}return b.prototype.update=function(){if(this.move.state==a.TapMove.STATE_REJECTED)this.rejectSoundPicker.playNextSound(),this.acceptSoundPicker.reset();else if(this.move.state==a.TapMove.STATE_ACCEPTED){var b=this.move.cell,c=b.shape;if(c){var d=c.chain,e=d.size>=5;e?sound.playSound(this.soundConfig.moveAcceptedLarge):(this.acceptSoundPicker.playNextSound(),this.rejectSoundPicker.reset())}}},b}();a.MoveSoundSystem=b;var c=function(){function b(a,b){this.gameState=a,this.gameProgress=b,this.soundConfig=resources.getGameConfig().sound,this.gameOverSoundPlayed=!1}return b.prototype.onStartSystem=function(){},b.prototype.update=function(){this.gameState.state!=a.GameState.STATE_WON||this.gameOverSoundPlayed||(sound.playSound(this.soundConfig.levelComplete),this.gameOverSoundPlayed=!0),this.gameState.state!=a.GameState.STATE_LOST||this.gameOverSoundPlayed||(sound.playSound(this.soundConfig.gameOver),this.gameOverSoundPlayed=!0)},b}();a.GameOverSoundSystem=c}(game||(game={}));var game;!function(a){var b=function(b){function c(a,c){var d=this;b.call(this,"JellyDicePowerupButton"),this.gameState=a,this.gameProgress=c,this.addEventListener("click",function(){return d.activatePowerup()}),this.gameProgress.availableShuffleCount<=0&&this.addChild(new createjs.Sprite(resources.spritesheet,"ShopPowerupLocked"))}return __extends(c,b),c.prototype.activatePowerup=function(){if(this.gameState.state==a.GameState.STATE_AWAITING){if(0==this.gameProgress.availableShuffleCount){var b=resources.getMessage("shuffleNotAvailable");return b=b.replace("%stars%","10"),dialogs.showInfo(b),void sound.playSound(resources.getGameConfig().sound.purchaseFailed)}this.gameProgress.availableShuffleCount--,this.gameState.requestShuffle(),this.gameProgress.availableShuffleCount<=0&&(this.removeAllEventListeners("click"),this.addChild(new createjs.Sprite(resources.spritesheet,"ShopPowerupLocked"))),sound.playSound(resources.getGameConfig().sound.shuffle)}},c}(controls.IconButton);a.ShufflePowerupButtonSystem=b}(game||(game={}));var createjs;!function(a){function b(b){a.Ticker.on("tick",b,void 0,!0)}a.onNextTick=b}(createjs||(createjs={}));var pause;!function(a){function b(){return null!=k}function c(a,b){j=a,l=b}function d(a){k||(k=new m(a),j.addChild(k),l.pauseGame())}function e(){k&&(j.removeChild(k),k=null,l.resumeGame())}function f(a,b){var c,d=[],e=b.movesLimit;b.scoreGoal?(e?(c=resources.getMessage("goal.score"),c=c.replace("%score%",""+b.scoreGoal),c=c.replace("%moves%",""+e)):(c=resources.getMessage("goal.scoreNoMoves"),c=c.replace("%score%",""+b.scoreGoal)),d.push("HudIconScore")):b.collectFruits&&b.cookieGoal?(c=resources.getMessage("goal.fruitsAndCookie"),c=c.replace("%cookies%",""+b.cookieGoal),c=c.replace("%moves%",""+e),d.push("HudIconFruitsAndCookies")):b.collectFruits?(c=resources.getMessage("goal.fruits"),c=c.replace("%moves%",""+e),h(a,c),d.push("HudIconFruits")):b.cookieGoal?(c=resources.getMessage("goal.cookies"),c=c.replace("%cookies%",""+b.cookieGoal),c=c.replace("%moves%",""+e),d.push("HudIconCookies")):b.bossHealth&&(c=resources.getMessage("goal.boss"),d.push("HudIconBoss")),h(a,c),g(d,b.bonuses),i(a,d)}function g(a,b){if(b)for(var c=b.split(",").map(function(a){return a.trim()}),d=0,e=c.length;e>d;d++){var f=c[d],g=n[f];g&&a.push(g)}}function h(a,b){var c=controls.createText(a,"GoalText",resources.getGameConfig().goal.style.goalText,b);c.textAlign="center"}function i(a,b){var c=b.length;if(0!=c){var d=new createjs.Container;d.name="GoalIcon",a.addChild(d);for(var e=75,f=-(c-1)*e/2,g=0;c>g;g++){var h=b[g],i=new createjs.Sprite(resources.spritesheet);i.name="GoalIcon",i.gotoAndStop(h),i.x=f,f+=e,d.addChild(i)}return i}}var j,k,l;a.isPaused=b,a.initialize=c,a.pauseGame=d,a.continueGame=e;var m=function(a){function b(b){var c=this;a.call(this);var d=controls.getFullScreenWipeImage("BlackRect");this.addChild(d),d.alpha=.8;var g=new createjs.Bitmap(resources.get("full_screen_panel"));g.name="PanelBackground",this.addChild(g),f(this,b),controls.createStaticImage(this,"PauseTitle"),controls.createSponsorLogo(this);var h=controls.createIconButton(this,"PlayButton",e);controls.addDefaultButtonAnimation(h,.504),controls.createIconButton(this,"RestartButton",function(){e(),l.restartGame()}),controls.createIconButton(this,"QuitButton",function(){e(),l.quitGame()}),soundControls.createSoundFXButton(this,"SoundFXButton"),soundControls.createMusicButton(this,"MusicButton"),controls.readLayout(this,resources.layout.GamePauseScreen),createjs.onNextTick(function(){controls.bounceButton(c,"ResumeButton",0,500),controls.bounceButton(c,"QuitButton",100,700),controls.bounceButton(c,"RestartButton",200,700),controls.bounceButton(c,"SoundFXButton",400,0),controls.bounceButton(c,"MusicButton",500,0)})}return __extends(b,a),b}(createjs.Container);a.createGoalDescription=f;var n={extraMoves:"PlusPowerup",bomb:"BombPowerup",rowClear:"RowClearPowerup",columnClear:"ColumnClearPowerup"}}(pause||(pause={}));var game;!function(a){var b=function(b){function c(a,c,d){b.call(this),this.levelDef=a,this.gameState=c,this.move=d,this.visible=!1;var e=a.hintText,f=a.hintIcon||"ProfessorNormal";controls.createStaticImage(this,"TutorialWindow");var g=resources.getMessage(e),h=controls.createText(this,"TutorialText",resources.getGameConfig().style.tutorialText,g);h.textAlign="center";var i=h.getBounds();h.cache(i.x,i.y,i.width,i.height);var j=controls.createStaticImage(this,f);j.name="Avatar";var k=resources.layout.TutorialWindow;controls.readLayout(this,k),this.timeout=resources.getGameConfig().animation.tutorialDelay}return __extends(c,b),c.prototype.update=function(b){if(!this.shown)if(this.visible||this.gameState.state!=a.GameState.STATE_AWAITING)(this.move.state==a.TapMove.STATE_ACCEPTED||this.move.state==a.TapMove.STATE_ENTERED)&&(createjs.Tween.removeTweens(this),createjs.Tween.get(this).to({alpha:0},300).to({visible:!1}),this.shown=!0);else{if(this.timeout>0)return void(this.timeout-=b);this.visible=!0,this.alpha=0,createjs.Tween.get(this).to({alpha:1},300)}},c}(createjs.Container);a.OneStepTutorialSystem=b;var c=function(a){function b(){a.call(this);var b=new createjs.Sprite(resources.spritesheet);b.gotoAndStop("HintArrow"),this.addChild(b),this.time=0,this.arrow=b,this.visible=!1}return __extends(b,a),b.prototype.update=function(a){this.time>3e3&&(this.visible=!0);var b=Math.sin(this.time/100);this.arrow.x=10*-b,this.arrow.y=10*b,this.time+=a},b}(createjs.Container);a.HintArrowDisplay=c}(game||(game={}));var treasures;!function(a){function b(a){for(var b=a.treasures,c=0,d=b.length;d>c;++c){var e=b[c];f[e.name]=e}this.treasureList=b}function c(a,b){var c=f[a];return c?c.levelc;++c){var e=b[c];if(a==e.level)return e}return null}function e(a,b,c){var d=new g(b,function(){a.removeChild(d),c()});a.addChild(d)}var f={};a.initialize=b,a.isTreasureEnabled=c,a.getEarnedTreasure=d,a.showDialog=e;var g=function(a){function b(b,c){a.call(this),this.treasureDef=b,this.onCollect=c;var d=controls.getFullScreenWipeImage("BlackRect");this.addChild(d),d.alpha=.3;var e=new createjs.Bitmap(resources.get("full_screen_panel"));this.addChild(e),controls.createStaticImage(this,"TreasureTitle");var f=controls.createStaticImage(this,b.icon);f.name="TreasureIcon";var g=resources.getMessage(b.hintKey),h=new createjs.Text(g,resources.getGameConfig().style.goalText,resources.getGameConfig().style.goalTextColor);h.name="TreasureHint",h.textAlign="center",this.addChild(h);var i=controls.createIconButton(this,"CollectTreasureButton",c);controls.addDefaultButtonAnimation(i),controls.readLayout(this,resources.layout.TreasureDialog),this.alpha=0,createjs.Tween.get(this).to({alpha:1,time:400})}return __extends(b,a),b}(createjs.Container)}(treasures||(treasures={}));var game;!function(a){var b=function(){function b(a,b,c,d,e){this.gameState=a,this.gameProgress=b,this.gameGrid=c,this.visualGrid=d,this.tapMove=e,this.currentMoveTimeoutMillis=0,this.moveTimeoutMillis=resources.getGameConfig().bonusesForExtraMoves.timeout,this.minChain=resources.getGameConfig().gameplay.minChain}return b.prototype.update=function(){if(!(this.gameState.delayTimeoutMillis>0)){if(!this.gameState.extraMovesBonusEnabled)return void(this.gameState.state==a.GameState.STATE_WON&&(this.gameState.extraMovesBonusEnabled=!0,this.gameState.bonusesSuppressed=!0));if(this.gameState.state==a.GameState.STATE_WON&&(this.gameState.state=a.GameState.STATE_AWAITING),this.gameState.state==a.GameState.STATE_AWAITING){if(!this.gameProgress.initialMovesCount||this.gameProgress.remainingMovesCount<=0||this.gameState.noMoves)return this.gameState.state=a.GameState.STATE_WON_BONUS_COMPLETE,void this.gameState.requestDelay(500);var b=this.gameState.availableMoveChain;if(b){var c=5;this.gameProgress.remainingMovesCount0;++e){var f=c[e];if(f.size>=this.minChain){var g=f.getRandomShape();this.gameGrid.activateChain(this.gameGrid.getCell(g.column,g.row)),--d,this.gameState.state=a.GameState.STATE_ACTIVATING}}},b}();a.RandomBonusMoveSystem=b;var c=function(){function b(a,b,c,d,e){this.gameState=a,this.gameGrid=b,this.tapMove=c,this.bonusPicker=d,this.gameplayConfig=e}return b.prototype.update=function(){if(!this.gameState.bonusesSuppressed){var a=this.gameGrid.activatedChainsQueue;if(0!=a.length){var b=a.getElement(0);if(b.size>=this.gameplayConfig.minBonusChain&&this.bonusPicker.isBonusAvailable){var c=this.bonusPicker.pickBonusType();this.grantPowerup(b,c)}}}},b.prototype.grantPowerup=function(b,c){var d=this.tapMove.cell,e=this.getTargetBonusCell(b,d);if(e){var f=b.firstShape.colorIndex,g=f;this.gameGrid.createBonusGameShape(e.column,e.row,a.layouts.BOX_1x1,g,c),sound.playSound(resources.getGameConfig().sound.powerupgranted)}},b.prototype.getTargetBonusCell=function(a,b){for(var c=a.firstShape,d=null;c;){if(c.bonusType&&1!=c.bonusType)return null;c.fruitsCount<=0&&(d=c),c=c.nextInChain}var e=b.shape;return e.fruitsCount>0?this.gameGrid.getCell(d.column,d.row):b},b}();a.BonusGrantingSystem=c;var d=function(){function b(a,b,c,d,e){this.gameState=a,this.gameGrid=b,this.tapMove=c,this.gameProgress=d,this.effectQueue=e,this.extraMovesBonus=resources.getGameConfig().gameplay.extraMovesBonus,this.maxMoves=resources.getGameConfig().gameplay.maxMoves}return b.prototype.update=function(){if(this.gameState.state==a.GameState.STATE_ACTIVATING){for(var b=this.gameGrid.activatedChainsQueue,c=0,d=b.length;d>c;++c)for(var e=b.getElement(c),f=e.firstShape;f;){var g=this.tapMove.cell;g||(g=this.gameGrid.getCell(f.column,f.row)),this.activateBonusesOnShape(f,g),f=f.nextInChain}for(var h=this.gameGrid.activatedShapesQueue,c=0,d=h.length;d>c;++c){var f=h.getElement(c),g=this.gameGrid.getCell(f.column,f.row);this.activateBonusesOnShape(f,g)}}},b.prototype.endFrame=function(){1==this.effectQueue.state?this.effectQueue.startAnimation():2==this.effectQueue.state&&this.gameState.delayTimeoutMillis<=0&&(this.effectQueue.completeEffects(),this.effectQueue.state=0)},b.prototype.activateBonusesOnShape=function(b,c){if(-1==b.colorIndex&&this.gameProgress.activatedCookieCount++,0!=b.bonusType&&1!=b.bonusType){var d=new a.Effect;d.bonusType=b.bonusType,d.originalShape=b,d.targetCell=c,this.effectQueue.addEffect(d),2==b.bonusType&&(this.gameProgress.remainingMovesCount+=this.extraMovesBonus,this.gameProgress.remainingMovesCount>this.maxMoves&&(this.gameProgress.remainingMovesCount=this.maxMoves))}},b}();a.BonusActivationSystem=d}(game||(game={}));var game;!function(a){var b=function(){function a(a,b,c,d){this.gameState=a,this.gameProgress=b,this.gameGrid=c,this.levelConfig=d,this.gameProgress.bossHealth=+d.bossHealth,this.gameProgress.initialBossHealth=+d.bossHealth}return a.prototype.update=function(){this.gameGrid.explosionQueue.length>0&&this.damageBoss(this.gameGrid.explosionQueue.length)},a.prototype.damageBoss=function(a){this.gameProgress.bossHealth-=a,this.gameProgress.bossHealth<=0&&(this.gameProgress.bossHealth=0)},a}();a.BossSystem=b;var c=function(a){function b(b){a.call(this,resources.spritesheet,"BossHead"),this.gameGrid=b,this.screamTimeout=0}return __extends(b,a),b.prototype.update=function(a){this.gameGrid.explosionQueue.length>0&&(this.gotoAndStop("BossHeadScream"),this.screamTimeout=1e3),this.screamTimeout>0&&(this.screamTimeout-=a,this.screamTimeout<=0&&(this.gotoAndStop("BossHead"),this.screamTimeout=0))},b}(createjs.Sprite);a.BossHeadDisplaySystem=c}(game||(game={}));var game;!function(a){var b=function(){function b(b){this.powerupList=b,this.gameEngine=new a.GameEngine}return b.prototype.startGame=function(b){var c=this;window.win=function(){c.gameState.state=a.GameState.STATE_WON},window.lose=function(){c.gameState.state=a.GameState.STATE_LOST};var d=resources.getGameConfig(),e=d.defaultField;this.gameGrid=new a.GameGrid(e.columnCount,e.rowCount),this.visualGrid=new a.VisualGrid(e.visualRectangle,e.columnCount,e.rowCount),this.currentLevelIndex=b,this.gameEngine.stop();var f=resources.getGameLevel(b-1);this.levelConfig=f,f.layout&&this.gameGrid.readFromLayout(f.layout,f),this.bonusPicker=new a.BonusPicker(f),this.gameProgress=new a.GameProgress,this.gameProgress.scoreTarget=parseInt(f.scoreGoal,10)||0,this.gameProgress.initialMovesCount=this.gameProgress.remainingMovesCount=parseInt(f.movesLimit,10)||0,this.gameProgress.targetCookies=parseInt(f.cookieGoal,10)||0,this.gameProgress.starLevels=a.StarLevels.fromString(f.scoreStars),this.powerupTrigger=new a.PowerupTrigger,this.gameState=new a.GameState,this.tapMove=new a.TapMove,this.effectQueue=new a.EffectQueue,this.initializeGameplayConfig(),this.initializeBonuses(),this.startEngine(f)},b.prototype.initializeGameplayConfig=function(){this.gameplayConfig={};var a=resources.getGameConfig().gameplay;for(var b in resources.getGameConfig().gameplay)this.gameplayConfig[b]=a[b]},b.prototype.initializeBonuses=function(){var a=this.powerupList.powerupArray;this.gameProgress.bonusMovesAvailable=0,this.gameProgress.availableShuffleCount=0;for(var b=0,c=a.length;c>b;b++){var d=a[b];if(d.purchased){var e=d.config;e.extraMoves&&(this.gameProgress.bonusMovesAvailable+=e.extraMoves),e.shuffles&&(this.gameProgress.availableShuffleCount+=e.shuffles),e.bonusChainReduction&&(this.gameplayConfig.minBonusChain-=e.bonusChainReduction),e.extraInitialPowerups&&(this.gameplayConfig.initialPowerupDrop+=e.extraInitialPowerups)}}},b.prototype.startEngine=function(b){var c=this,d=!!b.bossHealth,e=b.movesLimit,f=this.gameProgress.scoreTarget>0,g="tutorial.moves"==b.hintText,h=0!=this.gameProgress.targetCookies,i=this.gameGrid.initialAggregateFruitCounter>0,j=i||h,k=[{system:new a.MovesCheckSystem(this.gameGrid,this.gameState)},f&&{system:new a.ScoreTargetSystem(this.gameProgress,this.gameState,a.GameState.STATE_WON)},d&&{system:new a.BossDeadSystem(this.gameProgress,this.gameState,a.GameState.STATE_WON)},j&&{system:new a.CollectiblesTargetSystem(this.gameProgress,this.gameGrid,this.gameState,a.GameState.STATE_WON)},e&&{system:new a.MovesLimitSystem(this.gameProgress,this.powerupTrigger,this.gameState)},{system:new a.PlayerMoveSystem(this.gameEngine.getStage(),this.tapMove,this.gameGrid,this.visualGrid,this.gameState)},{system:new a.MechanicsSystem(b,this.gameState,this.gameGrid,this.tapMove,this.effectQueue,this.gameplayConfig,this.bonusPicker)},{system:new a.RandomBonusMoveSystem(this.gameState,this.gameProgress,this.gameGrid,this.visualGrid,this.tapMove)},{system:new a.BonusGrantingSystem(this.gameState,this.gameGrid,this.tapMove,this.bonusPicker,this.gameplayConfig)},{system:new a.BonusActivationSystem(this.gameState,this.gameGrid,this.tapMove,this.gameProgress,this.effectQueue)},e&&{system:new a.MoveCountSystem(this.gameState,this.gameProgress,this.tapMove)},{system:new a.ScoreSystem(this.gameGrid,this.gameProgress,this.gameState)},{system:new a.GameBackgroundSystem(this.currentLevelIndex),zOrder:10},{system:new a.GridVisualizationSystem(this.tapMove,this.gameGrid,this.visualGrid,this.gameState),zOrder:20,name:"Field"},this.bonusPicker.isBonusAvailable&&{system:new a.ShapeHighlightsSystem(this.gameGrid,this.visualGrid,this.gameState,this.gameplayConfig),zOrder:21},{system:new a.ExplosiveEffectSystem(this.gameState,this.visualGrid,this.effectQueue),zOrder:201},{system:new a.CollectEffectVisualizationSystem(this.gameState,this.gameGrid,this.effectQueue),zOrder:200},d&&{system:new a.BossSystem(this.gameState,this.gameProgress,this.gameGrid,b)},{system:new a.NextMoveVisualizationSystem(this.gameState)},{system:new a.FloatingScoresSystem(this.tapMove,this.gameState,this.gameGrid,this.visualGrid),zOrder:30},{system:new a.GameHUDPanel(!0),zOrder:100},{system:new a.GameScoreHUD(this.gameProgress),zOrder:110,name:"ScoreText"},f&&{system:new a.GameScoreProgressHUD(this.gameProgress),zOrder:120,name:"ScoreProgress"},j&&{system:new a.CollectiblesProgressHUD(this.gameProgress,this.gameGrid),zOrder:120,name:"ScoreProgress"},f&&{system:new a.GameScoreGoalHUD(this.gameProgress),zOrder:120,name:"GoalText"},h&&{system:new a.GameCollectiblesTextProgress(this.gameGrid,this.gameProgress),zOrder:120,name:"CollectiblesText"},d&&{system:new a.BossProgressHUD(this.gameProgress),zOrder:120,name:"ScoreProgress"},d&&{system:new a.BossHeadDisplaySystem(this.gameGrid),zOrder:15,name:"BossHead"},e&&{system:new a.GameTextMovesHUD(this.gameState,this.gameProgress),zOrder:130,name:"MovesText"},{system:new a.StarProgressHUDSystem(this.gameProgress),name:"StarProgress",zOrder:140},{system:new a.GameOverSoundSystem(this.gameState,this.gameProgress)},{system:new a.MoveSoundSystem(this.tapMove)},{system:new a.GameOverMessageSystem(this.gameState),zOrder:2e4},{system:new a.PauseButtonSystem(this.levelConfig),name:"PauseButton",zOrder:1e3},{system:new a.ShufflePowerupButtonSystem(this.gameState,this.gameProgress),name:"JellyDicePowerupButton",zOrder:1e3},{system:new a.PowerupActivationMessageSystem(this.powerupTrigger),zOrder:490},this.levelConfig.hintText&&{system:new a.OneStepTutorialSystem(this.levelConfig,this.gameState,this.tapMove),name:this.levelConfig.hintLayout||"TutorialWindow",zOrder:2e3},g&&{system:new a.HintArrowDisplay,name:"HintArrow",zOrder:2e4}],l=[];l=l.concat.apply(l,k),this.gameEngine.start(l),controls.readLayout(this.gameEngine,resources.layout.GameScreen),this.gameEngine.onAfterUpdate=function(a){return c.onAfterUpdate(a)}},b.prototype.onAfterUpdate=function(){this.gameState.delayTimeoutMillis<=0&&(this.gameState.state==a.GameState.STATE_LOST&&(this.gameEngine.stop(),this.onGameOver()),this.gameState.state==a.GameState.STATE_WON_BONUS_COMPLETE&&(this.gameEngine.stop(),this.onLevelComplete()))},b.prototype.stopGame=function(){this.gameEngine.stop(),this.gameGrid=null,this.visualGrid=null,this.gameState=null,this.tapMove=null,this.powerupTrigger=null,this.gameplayConfig=null,this.bonusPicker=null,this.effectQueue=null},b.prototype.restartGame=function(){this.stopGame(),this.startGame(this.currentLevelIndex)},b.prototype.pauseGame=function(){this.gameEngine.pause(),this.gameState.gamePaused=!0},b.prototype.resumeGame=function(){this.gameEngine.resume(),this.gameState.gamePaused=!1},b.prototype.quitGame=function(){this.gameState.state=a.GameState.STATE_LOST},b.prototype.onGameOver=function(){},b.prototype.onLevelComplete=function(){},b}();a.Game=b}(game||(game={}));var game;!function(a){var b=function(a){function b(){a.call(this);var b=new createjs.Sprite(resources.spritesheet);b.gotoAndStop("GameOverMessage"),b.x=320,b.y=320,this.gameOverMessage=b;var c=new createjs.Sprite(resources.spritesheet);c.gotoAndStop("LevelCompleteMessage"),c.x=320,c.y=320,this.levelCompleteMessage=c;var d=new createjs.Sprite(resources.spritesheet);d.gotoAndStop("RefillMessage"),this.refillMessage=d}return __extends(b,a),b.prototype.showRefillMessage=function(a,b){280>a?a=280:a>360&&(a=360),150>b?b=150:b>550&&(b=550),this.refillMessage.x=a,this.refillMessage.y=b,this.refillMessage.scaleX=this.refillMessage.scaleY=0,this.refillMessage.alpha=1,this.addChild(this.refillMessage),createjs.Tween.removeTweens(this.refillMessage),createjs.Tween.get(this.refillMessage).to({scaleX:.9,scaleY:.9},2500,createjs.Ease.getElasticOut(1,.3))},b.prototype.hideRefillMessage=function(){var a=this;this.refillMessage.parent&&createjs.Tween.get(this.refillMessage).wait(500).to({alpha:0},300).call(function(){return a.removeChild(a.refillMessage)})},b.prototype.showLevelCompleteMessage=function(){var a=this;this.refillMessage.parent&&(createjs.Tween.removeTweens(this.refillMessage),this.removeChild(this.refillMessage)),this.addChild(this.levelCompleteMessage),this.levelCompleteMessage.scaleX=0,this.levelCompleteMessage.scaleY=0,this.levelCompleteMessage.alpha=1,createjs.Tween.get(this.levelCompleteMessage).to({scaleX:1,scaleY:1},1500,createjs.Ease.elasticOut).wait(1700).to({alpha:0,scaleX:2,scaleY:2},300,createjs.Ease.quadOut).call(function(){return a.removeChild(a.levelCompleteMessage)})},b.prototype.floatScore=function(a,b,c,d){var e=this;"undefined"==typeof d&&(d=0);var f=new createjs.BitmapText("+"+a,resources.spritesheet);f.letterSpacing=-4,f.x=b-f.getBounds().width/2,f.y=c-50,this.addChild(f),f.alpha=0,createjs.Tween.get(f).wait(d).to({y:c-120},1200,createjs.Ease.circOut),createjs.Tween.get(f).wait(d).to({alpha:1},30).wait(1100).to({alpha:0},100).call(function(){return e.removeChild(f)})},b.prototype.showGameOverMessage=function(){this.addChild(this.gameOverMessage),this.gameOverMessage.scaleX=0,this.gameOverMessage.scaleY=0,createjs.Tween.get(this.gameOverMessage).to({scaleX:1,scaleY:1},1e3)},b.prototype.clear=function(){this.removeAllChildren()},b}(createjs.Container);a.MessageCanvas=b}(game||(game={}));var strings;!function(a){function b(a){for(var b=a+"";b.length<6;)b="0"+b;var c=b.length;return b.substr(0,c-6)+" "+b.substr(c-6,3)+" "+b.substr(c-3,3)}a.padScore=b}(strings||(strings={}));var metaModels;!function(a){var b=function(){function a(a){this.levelCount=a,this.scores=new Array(a),this.levelStars=new Array(a),this.setMemento(null)}return a.prototype.getMemento=function(){return{s:this.scores,st:this.levelStars}},a.prototype.setMemento=function(a){if(a){for(var b=0,c=this.levelCount;c>b;++b)this.scores[b]=a.s[b]||0,this.levelStars[b]=a.st[b]||0;this.recompute()}else for(var b=0,c=this.levelCount;c>b;++b)this.scores[b]=0,this.levelStars[b]=0},a.prototype.setScore=function(a,b,c){if(!(1>a||a>this.levelCount)){var d=a-1;(!this.scores[d]||b>this.scores[d])&&(this.scores[d]=b),(!this.levelStars[d]||c>this.levelStars[d])&&(this.levelStars[d]=c),this.recompute()}},a.prototype.getScore=function(a){return this.scores[a-1]},a.prototype.getNetScore=function(a){return this.totalScore-this.getScore(a)},a.prototype.getTotalScore=function(){return this.totalScore},a.prototype.getStarCount=function(a){return this.levelStars[a-1]},a.prototype.getTotalStarCount=function(){for(var a=0,b=0;b0},a.prototype.selectLevel=function(a){this.nextLevel=a},a.prototype.isValidSelection=function(a){return a<=this.completedLevel+1},a.prototype.completeLevel=function(a){return this.completedLevel=this.levelCount},a}();a.PlayerLevelProgress=c;var d=function(){function a(){this.amount=0}return a}();a.Coins=d}(metaModels||(metaModels={}));var scroller;!function(a){var b=function(){function a(a){this.target=a,this.events={}}return a.prototype.addEventListener=function(a,b){this.target.addEventListener(a,b),this.events[a]=b},a.prototype.removeAllEventListeners=function(){for(var a in this.events){var b=this.events[a];this.target.removeEventListener(a,b)}},a}(),c=function(){function a(a,b,c,d,e){this.content=a,this.contentWidth=b,this.contentHeight=c,this.clientWidth=d,this.clientHeight=e}return a.prototype.startScroll=function(a,c){var d=this;if(!this.scroller){var e=this.content.getStage();if(this.stageEventProxy=new b(e),!e)throw new Error("Scroller content object has to be added to the stage before use!");this.stage=e,this.scroller=new Scroller(function(a,b,c){return d.onScrollTo(a,b,c)},{scrollingY:!0,scrollingX:!0,zooming:!1,bouncing:!1});this.scroller.setDimensions(this.clientWidth,this.clientHeight,this.contentWidth,this.contentHeight),this.stageEventProxy.addEventListener("stagemousedown",function(a){return d.handleMouseDown(a)}),this.stageEventProxy.addEventListener("stagemouseup",function(a){return d.handleMouseUp(a)}),this.stageEventProxy.addEventListener("stagemousemove",function(a){return d.handleMouseMove(a)}),this.scroller.scrollTo(a,c)}},a.prototype.endScroll=function(){this.scroller&&(this.stageEventProxy.removeAllEventListeners(),this.scroller=null,this.stage=null,this.stageEventProxy=null)},a.prototype.onScrollTo=function(a,b){this.content.x=-a,this.content.y=-b},a.prototype.handleMouseDown=function(a){this.mouseDown||(a.nativeEvent.preventDefault&&a.nativeEvent.preventDefault(),this.scroller.doTouchStart([{pageX:a.stageX,pageY:a.stageY}],a.nativeEvent.timeStamp),this.mouseDown=!0)},a.prototype.handleMouseUp=function(a){if(this.mouseDown){var b=a.nativeEvent.timeStamp;a.nativeEvent.preventDefault&&a.nativeEvent.preventDefault(),this.scroller.doTouchEnd(b),this.mouseDown=!1}},a.prototype.handleMouseMove=function(a){this.mouseDown&&(a.nativeEvent.preventDefault&&a.nativeEvent.preventDefault(),this.scroller.doTouchMove([{pageX:a.stageX,pageY:a.stageY}],a.nativeEvent.timeStamp))},a}();a.DisplayObjectScroller=c;var d=function(a){function b(b,c){var d=this;a.call(this),this.content=b,this.settings=c,this.emptyBackgroundHitArea=new createjs.Shape,this.emptyBackground=new createjs.Shape,this.emptyBackground.mouseEnabled=!0,this.emptyBackground.hitArea=this.emptyBackgroundHitArea,this.addChild(this.emptyBackground),this.addChild(b),this.scroller=new Scroller(function(a,b,c){return d.onScrollTo(a,b,c)},c.scrollSettings),this.contentWidth=c.contentWidth,this.contentHeight=c.contentHeight,this.clientWidth=c.clientWidth,this.clientHeight=c.clientHeight,this.updateHitArea(),this.scroller.setDimensions(this.clientWidth,this.clientHeight,this.contentWidth,this.contentHeight),this.addEventListener("mousedown",function(a){return d.handleMouseDown(a)}),this.addEventListener("pressmove",function(a){return d.handleMouseMove(a)}),this.addEventListener("pressup",function(a){return d.handleMouseUp(a)}),this.clip=this.settings.clip,this.clip&&this.addEventListener("tick",function(){return d.handleTick()}),this.mouseChildren=!0}return __extends(b,a),b.prototype.setClientDimensions=function(a,b){this.clientWidth=a,this.clientHeight=b,this.updateHitArea(),this.scroller.setDimensions(this.clientWidth,this.clientHeight,this.contentWidth,this.contentHeight)},b.prototype.setContentDimensions=function(a,b){this.contentWidth=a,this.contentHeight=b,this.scroller.setDimensions(this.clientWidth,this.clientHeight,this.contentWidth,this.contentHeight)},b.prototype.updateHitArea=function(){this.emptyBackgroundHitArea.graphics.clear().beginFill("#FFFFFF").drawRect(0,0,this.clientWidth,this.clientHeight)},b.prototype.onScrollTo=function(a,b){this.content.x=-a,this.content.y=-b},b.prototype.handleMouseDown=function(a){if(!this.mouseDown){var b=this.globalToLocal(a.rawX,a.rawY);a.nativeEvent.preventDefault&&a.nativeEvent.preventDefault(),this.scroller.doTouchStart([{pageX:b.x,pageY:b.y}],a.nativeEvent.timeStamp),this.mouseDown=!0,this.isActiveScrolling=!1,this.moveTouchPoint=b}},b.prototype.handleMouseUp=function(a){if(this.mouseDown){a.nativeEvent.preventDefault&&a.nativeEvent.preventDefault();var b=a.nativeEvent.timeStamp;this.scroller.doTouchEnd(b),this.mouseDown=!1,this.isActiveScrolling=!1}},b.prototype.handleMouseMove=function(a){if(this.mouseDown){a.nativeEvent.preventDefault&&a.nativeEvent.preventDefault();var b=this.globalToLocal(a.rawX,a.rawY); if(this.scroller.doTouchMove([{pageX:b.x,pageY:b.y}],a.nativeEvent.timeStamp),!this.isActiveScrolling){var c=this.moveTouchPoint.x-b.x,d=this.moveTouchPoint.y-b.y,e=c*c+d*d;e>100&&(this.isActiveScrolling=!0)}}},b.prototype.handleTick=function(){this.cache(0,0,this.clientWidth,this.clientHeight)},b}(createjs.Container);a.ScrollableContainer=d}(scroller||(scroller={}));var levelMap;!function(a){var b=function(a){function b(b,c){var e=this;a.call(this),this.levelCount=b,this.mapBackground=c,this.levelIcons=new createjs.Container,this.map=new createjs.Container,this.addChild(this.map),this.scrollableContent=new createjs.Container,this.map.addChild(this.scrollableContent),this.map.y=-controls.gameVerticalMargin;var f=2;c.scaleX=f,c.scaleY=f,this.scrollableContent.addChild(this.mapBackground),this.scrollableContent.addChild(this.levelIcons);var g=new createjs.Sprite(resources.spritesheet,"CurrentLevelMarker");this.avatar=g,this.scrollableContent.addChild(this.avatar);for(var h=resources.layout.MapScreen,i=0;i=g){h.complete();var i=c?c[g-1]:0;h.setStars(i)}else g==b+1?(h.unlock(),h.setStars(0)):(h.lock(),h.setStars(0))}var j=this.getLevelIcon(a);if(e&&a>1){var k=this.getLevelIcon(a-1);this.avatar.x=k.x,this.avatar.y=k.y,createjs.Tween.get(this.avatar).wait(400).to({x:j.x,y:j.y},1200,createjs.Ease.quadOut).wait(300).call(function(){f.onSelectLevel(a),f.scroller.endScroll()}),this.hudPanel.visible=!1}else this.avatar.x=j.x,this.avatar.y=j.y,this.hudPanel.visible=!0},b.prototype.startScroll=function(a){var b=this.getLevelIcon(a),c=b.x,d=b.y;d-=controls.gameHeight/2,0>d&&(d=0),c-=controls.gameWidth/2,0>c&&(c=0);var e=this.getStage().canvas.height;e>controls.screenHeight&&(e=controls.screenHeight),this.map.y=(controls.gameHeight-e)/2,this.hudPanel.y=this.map.y,this.scroller.clientHeight=e,this.scroller.startScroll(c,d)},b.prototype.onSelectLevel=function(){},b.prototype.isLevelSelectable=function(){return!0},b.prototype.quitLevelMap=function(){this.scroller.endScroll(),this.onQuit()},b.prototype.onQuit=function(){},b.prototype.showGameShop=function(){this.scroller.endScroll(),this.onGameShop()},b.prototype.onGameShop=function(){},b.prototype.getLevelIcon=function(a){return this.levelIcons.getChildAt(a-1)},b.prototype.onClickHandler=function(a){if(this.hudPanel.visible){var b=a.target.parent,c=b.levelNumber;this.isLevelSelectable(c)?(this.onSelectLevel(c),this.scroller.endScroll()):b.failClick();var d=resources.getGameConfig().sound;sound.playSound(d.buttonPressed)}},b}(createjs.Container);a.LevelMap=b;var c=function(a){function b(b){a.call(this,respack.get(b,"map")),this.width=this.image.width,this.height=this.image.height}return __extends(b,a),b}(createjs.Bitmap);a.MapStaticBackground=c;var d=function(a){function b(b){a.call(this),this.levelNumber=b,this.back=new createjs.Sprite(resources.spritesheet),this.addChild(this.back),this.text=controls.createBitmapText(this,"levelNumber",null,""+b),this.text.x=-this.text.getBounds().width/2,this.text.y=-25,this.addChild(this.text),this.text.mouseEnabled=!1}return __extends(b,a),b.prototype.lock=function(){this.setButton("LevelLocked")},b.prototype.unlock=function(){this.setButton("LevelUnlocked")},b.prototype.complete=function(){this.setButton("LevelComplete")},b.prototype.setStars=function(a){this.stars&&this.removeChild(this.stars),a&&(a>3&&(a=3),this.stars=new createjs.Sprite(resources.spritesheet),this.stars.gotoAndStop("MapStars"+a),this.addChild(this.stars))},b.prototype.setButton=function(a){this.back.gotoAndStop(a)},b.prototype.failClick=function(){createjs.Tween.hasActiveTweens(this)||createjs.Tween.get(this).to({x:this.x+25},100,createjs.Ease.linear).to({x:this.x},250,createjs.Ease.backOut)},b}(createjs.Container)}(levelMap||(levelMap={}));var powerups;!function(a){var b=function(a){function b(b){var d=this;a.call(this),this.powerupList=b,this.gameBackground=new game.GameBackground,this.highlightedPowerupSprite=new createjs.Sprite(resources.spritesheet,"ShopPowerupHighlighted"),this.addChild(this.gameBackground);var e=new createjs.Bitmap(respack.get("powerup-shop-background","shop"));e.name="PowerupShopBackground",this.addChild(e),controls.createStaticImage(this,"ShopStarCounter"),this.displayedCurrentStarsText=controls.createText(this,"StarCount",resources.getGameConfig().powerups.style.starCountStyle),controls.createIconButton(this,"QuitButton",function(){return d.onQuit()}),this.buyButton=controls.createIconButton(this,"GameShopBuyButton",function(){return d.purchaseSelectedPowerup()}),this.resetButton=controls.createIconButton(this,"RestartButton",function(){return d.reset()}),this.resetButton.scaleX=this.resetButton.scaleY=.65;var f=this.powerupList.powerupArray;this.powerupIcons=new Array(f.length);for(var g=0,h=f.length;h>g;g++){var i=f[g],j=new c(i,function(a){return d.selectPowerup(a)});this.addChild(j),this.powerupIcons[g]=j}this.addChild(this.highlightedPowerupSprite),this.powerupDescriptionText=controls.createText(this,"PowerupDescription",resources.getGameConfig().powerups.style.powerupDescription),controls.readLayout(this,resources.layout.PowerupShop)}return __extends(b,a),b.prototype.show=function(a){var b=this.powerupList.getTotalStarsSpent();this.currentStars=a-b,this.displayedCurrentStars=this.currentStars,this.refreshStars(),this.refreshPowerupIcons(),this.highlightedPowerupSprite.visible=!1,this.buyButton.setAnimation("GameShopBuyButtonDisabled")},b.prototype.refreshStars=function(){this.displayedCurrentStarsText.text=""+Math.floor(this.displayedCurrentStars);var a=this.powerupList.getTotalStarsSpent();this.resetButton.visible=a>0},b.prototype.refreshPowerupIcons=function(){for(var a=this.powerupIcons,b=0,c=a.length;c>b;b++){var d=a[b],e=d.powerup;e.purchased?d.setPurchased():e.config.starCost<=this.currentStars?d.setOpen():d.setLocked()}},b.prototype.onQuit=function(){},b.prototype.reset=function(){for(var a=this.powerupList.powerupArray,b=0,c=a.length;c>b;b++){var d=a[b];d.purchased&&(this.currentStars+=d.config.starCost,d.purchased=!1)}this.refreshPowerupIcons(),this.animateStarCountChange()},b.prototype.selectPowerup=function(a){return a.powerup==this.highlightedPowerup?void this.purchaseSelectedPowerup():(this.highlightedPowerupSprite.visible?(createjs.Tween.removeTweens(this.highlightedPowerupSprite),this.highlightedPowerupSprite.alpha=1,createjs.Tween.get(this.highlightedPowerupSprite).to({x:a.x,y:a.y},250,createjs.Ease.quadInOut)):(this.highlightedPowerupSprite.visible=!0,this.highlightedPowerupSprite.x=a.x,this.highlightedPowerupSprite.y=a.y,createjs.Tween.removeTweens(this.highlightedPowerupSprite),this.highlightedPowerupSprite.alpha=0,createjs.Tween.get(this.highlightedPowerupSprite).to({alpha:1},250)),this.highlightedPowerup=a.powerup,this.buyButton.setAnimation(this.highlightedPowerup.config.starCost<=this.currentStars?"GameShopBuyButton":"GameShopBuyButtonDisabled"),void(this.powerupDescriptionText.text=resources.getMessage("powerup.description."+a.powerup.config.id)))},b.prototype.purchaseSelectedPowerup=function(){if(this.highlightedPowerup&&!this.highlightedPowerup.purchased){if(this.highlightedPowerup.config.starCost>this.currentStars)return void sound.playSound(resources.getGameConfig().sound.purchaseFailed);this.currentStars-=this.highlightedPowerup.config.starCost,this.highlightedPowerup.purchased=!0,this.refreshPowerupIcons(),this.animateStarCountChange(),sound.playSound(resources.getGameConfig().sound.purchaseComplete)}},b.prototype.animateStarCountChange=function(){var a=this;createjs.Tween.removeTweens(this),createjs.Tween.get(this).to({displayedCurrentStars:this.currentStars},400).addEventListener("change",function(){return a.refreshStars()})},b}(createjs.Container);a.PowerupShop=b;var c=function(a){function b(b,c){var d=this;a.call(this),this.powerup=b,this.lockedIcon=new createjs.Sprite(resources.spritesheet,"ShopPowerupLocked"),this.equippedIcon=new createjs.Sprite(resources.spritesheet,"ShopPowerupEquipped");var e=b.config.icon;this.icon=controls.createIconButton(this,e,function(){return c(d)}),this.name=e,this.shopStarCounter=controls.createStaticImage(this,"ShopStarCounter"),this.shopStarCounter.scaleX=this.shopStarCounter.scaleY=.7,this.shopStarCounter.x=0,this.shopStarCounter.y=45,this.equippedIcon.x=this.shopStarCounter.x,this.equippedIcon.y=this.shopStarCounter.y,this.addChild(this.equippedIcon),this.addChild(this.lockedIcon),this.costText=controls.createText(this,"StarCount",resources.getGameConfig().powerups.style.starCostStyle),this.costText.x=0,this.costText.y=28,this.costText.text=""+b.config.starCost}return __extends(b,a),b.prototype.setOpen=function(){this.icon.alpha=1,this.equippedIcon.visible=!1,this.lockedIcon.visible=!1,this.shopStarCounter.visible=!0,this.costText.visible=!0,this.costText.color=resources.getGameConfig().powerups.style.starCostStyle.color},b.prototype.setLocked=function(){this.icon.alpha=.7,this.equippedIcon.visible=!1,this.lockedIcon.visible=!0,this.shopStarCounter.visible=!0,this.costText.visible=!0,this.costText.color=resources.getGameConfig().powerups.style.starCostDisabledStyle.color},b.prototype.setPurchased=function(){this.icon.alpha=1,this.equippedIcon.visible=!0,this.lockedIcon.visible=!1,this.shopStarCounter.visible=!1,this.costText.visible=!1,this.costText.color=resources.getGameConfig().powerups.style.starCostStyle.color},b}(createjs.Container)}(powerups||(powerups={}));var comixes;!function(a){var b=function(a){function b(b,c){a.call(this),this.comixes=b,this.comixSpritesheetName=c}return __extends(b,a),b.prototype.isComixAvailable=function(a){var b=this.comixes.entries[a];return null!=b},b.prototype.showComix=function(a){var b=this,c=this.comixes.entries[a];return c?(respack.waitFor("comix",function(){b.comixSpritesheet=respack.getSpritesheet(b.comixSpritesheetName,"comix"),b.currentComixEntry=c,b.currentPageIndex=0,b.currentFrameIndex=0,b.showPage(),b.addEventListener("click",function(){return b.click()}),b.addEventListener("tick",function(){return b.tick()})}),!0):!1},b.prototype.tick=function(){if(this.currentComixEntry){var a=1e3/30;if(this.currentFrameTimeout>0&&(this.currentFrameTimeout-=a,this.currentFrameTimeout<=0)){var b=this.showNextFrame();b||(this.currentFrameTimeout=this.comixes.frameDelay)}}},b.prototype.click=function(){if(this.currentComixEntry)if(this.isPageComplete())this.nextPage();else do var a=this.showNextFrame();while(!a)},b.prototype.showPage=function(){this.currentFrameIndex=0,this.removeAllChildren(),controls.createSolidRect(this,this.comixes.backgroundColor),this.currentFrameTimeout=this.comixes.firstFrameDelay},b.prototype.nextPage=function(){return this.currentPageIndex++,this.currentPageIndex>=this.currentComixEntry.pages.length?void this.completeComix():void this.showPage()},b.prototype.isPageComplete=function(){var a=this.currentComixEntry.pages[this.currentPageIndex];return this.currentFrameIndex>=a.length},b.prototype.showNextFrame=function(){var a=this,b=this.currentComixEntry.pages[this.currentPageIndex];if(this.currentFrameIndex=this.maxEntriesPerLevel;)a.levelStatistics.shift();a.levelStatistics.push(b)},a}();a.GameStatistics=i;var j;a.initialize=b,a.logLevelStatistics=c,a.get=d}(gametracker||(gametracker={}));var ui;!function(a){function b(a){if(a.scoreTarget){var b=resources.getMessage("cod.scoreGoal");return b=b.replace("%scoreGoal%",""+a.scoreTarget)}if(a.targetCookies){var b=resources.getMessage("cod.cookieGoal");return b=b.replace("%earnedCookies%",""+a.activatedCookieCount),b=b.replace("%cookieGoal%",""+a.targetCookies)}if(a.bossHealth>0){var b=resources.getMessage("cod.bossAlive");return b}return resources.getMessage("cod.fruitGoal")}function c(a,b){var c=new createjs.Sprite(resources.spritesheet);return c.name="Avatar",c.scaleX=c.scaleY=.7,b&&c.gotoAndStop(b),a.addChild(c),c}var d=function(){function a(a){var b=this;this.mainMenu=new e,this.gameOver=new f,this.levelComplete=null,this.credits=new i,this.goalBriefing=new h,this.levelMap=null,this.powerupShop=null,this.game=null,this.uiContainer=null,this.playerLevelProgress=new metaModels.PlayerLevelProgress(resources.getGameLevelCount()),this.levelScores=new metaModels.LevelScores(resources.getGameLevelCount()),this.gameIsJustComplete=!1,this.currentLevel=1,this.comix=new comixes.Comix(resources.getGameConfig().comixes,"comix-jellyquest");var c=resources.getGameConfig().powerups.list;this.powerupList=powerups.PowerupList.createFromConfig(c),this.loadProgress(),this.game=new game.Game(this.powerupList),treasures.initialize(resources.getGameConfig()),this.uiContainer=a,this.mainMenu.onStartGame=this.transitionTo(function(){return b.clickPlayButton()},resources.getGameConfig().sound.musicGame),this.game.onLevelComplete=this.transitionTo(function(){return b.showLevelComplete()}),this.game.onGameOver=this.transitionTo(function(){return b.showGameOver()}),this.gameOver.onRetry=this.transitionTo(function(){return b.retryGame()},resources.getGameConfig().sound.musicGame),this.gameOver.onQuit=this.transitionTo(function(){return b.showMap()}),this.levelComplete=new g,this.levelComplete.onQuit=this.transitionTo(function(){return b.showMap()}),this.levelComplete.onRetry=this.transitionTo(function(){return b.retryGame()},resources.getGameConfig().sound.musicGame),this.levelComplete.onContinue=this.transitionTo(function(){return b.nextLevel()},resources.getGameConfig().sound.musicGame),this.mainMenu.onShowCredits=this.transitionTo(function(){return b.showCredits()}),this.mainMenu.onResetProgress=this.transitionTo(function(){return b.resetProgress()}),this.credits.onQuit=this.transitionTo(function(){return b.showMenu()}),this.goalBriefing.onContinue=this.transitionTo(function(){return b.startCurrentLevel()}),this.goalBriefing.onShowPowerupShop=this.transitionTo(function(){return b.showPowerupShop()}),this.goalBriefing.onQuit=this.transitionTo(function(){return b.showMap()}),this.comix.onComixComplete=this.transitionTo(function(){return b.comixComplete()}),pause.initialize(a,this.game),dialogs.initialize(a),window.unlockAll=function(){b.unlockAll()},gametracker.initialize("com.jellimatic.JellyQuest",50)}return a.prototype.getMememto=function(){return{playerLevelProgress:this.playerLevelProgress.getMemento(),levelScores:this.levelScores.getMemento(),powerupList:this.powerupList.getMemento()}},a.prototype.setMemento=function(a){this.playerLevelProgress.setMemento(a&&a.playerLevelProgress),this.levelScores.setMemento(a&&a.levelScores),this.powerupList.setMemento(a&&a.powerupList)},a.prototype.launchApp=function(){this.showMenu()},a.prototype.comixComplete=function(){this.gameIsJustComplete?(sound.playMusic(resources.getGameConfig().sound.musicMenu),this.showMenu()):this.showLevelGoal()},a.prototype.transitionTo=function(a,b){var c=this;return function(){for(var d=[],e=0;e-1&&!(navigator.userAgent.indexOf("Chrome")>-1);controls.initialize(640,g?712:960,640,712),sound.initialize(a.gameId),a.stage=new createjs.Stage(a.canvas),a.stage.autoClear=!0,a.gameContainer=a.stage,a.gameContainer.y=controls.gameVerticalMargin,a.stage.update(),createjs.Ticker.setFPS(resources.getGameConfig().global.fps),createjs.Ticker.timingMode=createjs.Ticker.RAF,createjs.Ticker.addEventListener("tick",d),g&&createjs.Touch.isSupported()&&a.stage.enableDOMEvents(!1),createjs.Touch.enable(a.stage),resources.preloadGameAssets(a.gameContainer,c),window.addEventListener("resize",e,!1),e()}function c(){return a.uiController=new ui.Controller(a.gameContainer),resources.portalConfig.api&&resources.portalConfig.api.gameLoadingComplete(),resources.urlParameters.playLevel?void a.uiController.selectLevelFromMap(parseInt(resources.urlParameters.playLevel)):void a.uiController.launchApp()}function d(b){a.stage.update(b)}function e(){var a=window.innerWidth,b=window.innerHeight;f(a,b)}function f(b,c){var d=b,e=c;if(j!==d||k!==e){j=d,k=e;var f=controls.screenWidth,h=controls.screenHeight,i=controls.gameplayRectangle.height,l=d/f,m=e/i,n=Math.min(l,m);resources.urlParameters.fixed&&(n=1);var o=e/n;o>h&&(o=h);var p=controls.screenWidth,q=Math.floor(o);a.canvas.width=p,a.canvas.height=q,g(q);var r=a.canvas.width*n,s=a.canvas.height*n;a.canvas.style.width=r+"px",a.canvas.style.height=s+"px";var t=a.canvas.parentElement;t.style.width=r+"px",t.style.height=s+"px";var u=(d-r)/2;t.style.left=u+"px";var v=(e-s)/2;t.style.top=v+"px"}}function g(b){if(a.gameContainer){var c=(controls.screenHeight-b)/2;a.gameContainer.y=controls.gameVerticalMargin-c}}function h(){sound.settings.setSoundFX(!1),sound.settings.setMusic(!1)}function i(){sound.settings.setSoundFX(!0),sound.settings.setMusic(!0)}a.canvas,a.stage,a.uiController,a.gameId="com.jellimatic.JellyQuest",a.portraitLock=null,a.gameContainer,a.initialize=b;var j=-1,k=-1;a.onResizeCalled=e,a.mute=h,a.unmute=i}(app||(app={}));