UNPKG

@danzen/createjs

Version:

A version of CreateJS https://createjs.com that that provides a Bitmap Object Model (BOM) and events to run with ZIMjs the JavaScript Canvas Framework https://zimjs.com

31 lines (29 loc) 248 kB
/*! * CreateJS * Visit http://createjs.com/ for documentation, updates and examples. * * Copyright (c) 2010 gskinner.com, inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ // ZIM version - createjs 1.4.0 var createjs=createjs||{};function makeRemotePointers(){createjs.addRemotePointers=function(t,e){createjs.remoteOriginalDOM=t._eventListeners,t.enableDOMEvents(!1),createjs.remotePointers=!0,e&&(Array.isArray(e)||(e=[e]),createjs.remoteTargets=e)},createjs.removeRemotePointers=function(t){createjs.remoteOriginalDOM&&t.enableDOMEvents(!0),createjs.remotePointers=!1,createjs.remoteTargets=null},createjs.handleRemotePointer=function(t,e,i,s,r,n){null==n&&(n=-1),"move"==i?r._handlePointerMove(n,s,t,e):"down"==i?r._handlePointerDown(n,s,t,e):"up"==i&&r._handlePointerUp(n,s,!1)}}createjs.stageTransformable=!0,createjs.willReadFrequently=!0,createjs.extend=function(t,e){"use strict";function i(){this.constructor=t}return i.prototype=e.prototype,t.prototype=new i},createjs.promote=function(t,e){"use strict";var i=t.prototype,s=Object.getPrototypeOf&&Object.getPrototypeOf(i)||i.__proto__;if(s)for(var r in i[(e+="_")+"constructor"]=s.constructor,s)i.hasOwnProperty(r)&&"function"==typeof s[r]&&(i[e+r]=s[r]);return t},createjs.indexOf=function(t,e){"use strict";for(var i=0,s=t.length;i<s;i++)if(e===t[i])return i;return-1},function(){"use strict";function t(){throw"UID cannot be instantiated"}t._nextID=0,t.get=function(){return t._nextID++},createjs.UID=t}(),createjs.deprecate=function(e,i){"use strict";return function(){var t="Deprecated property or method '"+i+"'. See docs for info.";return console&&(console.warn?console.warn(t):console.log(t)),e&&e.apply(this,arguments)}},function(){"use strict";function t(t,e,i){this.type=t,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!e,this.cancelable=!!i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var e=t.prototype;e.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},e.stopPropagation=function(){this.propagationStopped=!0},e.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},e.remove=function(){this.removed=!0},e.clone=function(){return new t(this.type,this.bubbles,this.cancelable)},e.set=function(t){for(var e in t)this[e]=t[e];return this},e.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=t}(),function(){"use strict";function t(){this._listeners=null,this._captureListeners=null}var e=t.prototype;t.initialize=function(t){t.addEventListener=e.addEventListener,t.on=e.on,t.removeEventListener=t.off=e.removeEventListener,t.removeAllEventListeners=e.removeAllEventListeners,t.hasEventListener=e.hasEventListener,t.dispatchEvent=e.dispatchEvent,t._dispatchEvent=e._dispatchEvent,t.willTrigger=e.willTrigger},e.addEventListener=function(t,e,i){var s=i?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{},r=s[t];return r&&this.removeEventListener(t,e,i),(r=s[t])?r.push(e):s[t]=[e],e},e.on=function(t,e,i,s,r,n){return e.handleEvent&&(i=i||e,e=e.handleEvent),i=i||this,this.addEventListener(t,function(t){e.call(i,t,r),s&&t.remove()},n)},e.removeEventListener=function(t,e,i){var s=i?this._captureListeners:this._listeners;if(s){var r=s[t];if(r)for(var n=0,a=r.length;n<a;n++)if(r[n]==e){1==a?delete s[t]:r.splice(n,1);break}}},e.off=e.removeEventListener,e.removeAllEventListeners=function(t){t?(this._listeners&&delete this._listeners[t],this._captureListeners&&delete this._captureListeners[t]):this._listeners=this._captureListeners=null},e.dispatchEvent=function(t,e,i){if("string"==typeof t){var s=this._listeners;if(!(e||s&&s[t]))return!0;t=new createjs.Event(t,e,i)}else t.target&&t.clone&&(t=t.clone());try{t.target=this}catch(t){}if(t.bubbles&&this.parent){for(var r=this,n=[r];r.parent;)n.push(r=r.parent);for(var a=n.length,o=a-1;0<=o&&!t.propagationStopped;o--)n[o]._dispatchEvent(t,1+(0==o));for(o=1;o<a&&!t.propagationStopped;o++)n[o]._dispatchEvent(t,3)}else this._dispatchEvent(t,2);return!t.defaultPrevented},e.hasEventListener=function(t){var e=this._listeners,i=this._captureListeners;return!!(e&&e[t]||i&&i[t])},e.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.parent}return!1},e.toString=function(){return"[EventDispatcher]"},e._dispatchEvent=function(t,e){var i,s,r=e<=2?this._captureListeners:this._listeners;if(t&&r&&(s=r[t.type])&&(i=s.length)){try{t.currentTarget=this}catch(t){}try{t.eventPhase=0|e}catch(t){}t.removed=!1,s=s.slice();for(var n=0;n<i&&!t.immediatePropagationStopped;n++){var a=s[n];a.handleEvent?a.handleEvent(t):a(t),t.removed&&(this.off(t.type,a,1==e),t.removed=!1)}}2===e&&this._dispatchEvent(t,2.1)},createjs.EventDispatcher=t}(),function(){"use strict";function n(){throw"Ticker cannot be instantiated."}n.RAF_SYNCHED="synched",n.RAF="raf",n.TIMEOUT="timeout",n.timingMode=null,n.maxDelta=0,n.paused=!1,n.removeEventListener=null,n.removeAllEventListeners=null,n.dispatchEvent=null,n.hasEventListener=null,n._listeners=null,createjs.EventDispatcher.initialize(n),n._addEventListener=n.addEventListener,n.addEventListener=function(){return n._inited||n.init(),n._addEventListener.apply(n,arguments)},n._inited=!1,n._startTime=0,n._pausedTime=0,n._ticks=0,n._pausedTicks=0,n._interval=50,n._lastTime=0,n._times=null,n._tickTimes=null,n._timerId=null,n._raf=!0,n._setInterval=function(t){n._interval=t,n._inited&&n._setupTick()},n.setInterval=createjs.deprecate(n._setInterval,"Ticker.setInterval"),n._getInterval=function(){return n._interval},n.getInterval=createjs.deprecate(n._getInterval,"Ticker.getInterval"),n._setFPS=function(t){n._setInterval(1e3/t)},n.setFPS=createjs.deprecate(n._setFPS,"Ticker.setFPS"),n._getFPS=function(){return 1e3/n._interval},n.getFPS=createjs.deprecate(n._getFPS,"Ticker.getFPS");try{Object.defineProperties(n,{interval:{get:n._getInterval,set:n._setInterval},framerate:{get:n._getFPS,set:n._setFPS}})}catch(t){console.log(t)}n.init=function(){n._inited||(n._inited=!0,n._times=[],n._tickTimes=[],n._startTime=n._getTime(),n._times.push(n._lastTime=0),n.interval=n._interval)},n.reset=function(){var t;n._raf?(t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame)&&t(n._timerId):clearTimeout(n._timerId),n.removeAllEventListeners("tick"),n._timerId=n._times=n._tickTimes=null,n._startTime=n._lastTime=n._ticks=n._pausedTime=0,n._inited=!1},n.getMeasuredTickTime=function(t){var e=0,i=n._tickTimes;if(!i||i.length<1)return-1;t=Math.min(i.length,t||0|n._getFPS());for(var s=0;s<t;s++)e+=i[s];return e/t},n.getMeasuredFPS=function(t){var e=n._times;return!e||e.length<2?-1:(t=Math.min(e.length-1,t||0|n._getFPS()),1e3/((e[0]-e[t])/t))},n.getTime=function(t){return n._startTime?n._getTime()-(t?n._pausedTime:0):-1},n.getEventTime=function(t){return n._startTime?(n._lastTime||n._startTime)-(t?n._pausedTime:0):-1},n.getTicks=function(t){return n._ticks-(t?n._pausedTicks:0)},n._handleSynch=function(){n._timerId=null,n._setupTick(),n._getTime()-n._lastTime>=.97*(n._interval-1)&&n._tick()},n._handleRAF=function(){n._timerId=null,n._setupTick(),n._tick()},n._handleTimeout=function(){n._timerId=null,n._setupTick(),n._tick()},n._setupTick=function(){if(null==n._timerId){var t=n.timingMode;if(t==n.RAF_SYNCHED||t==n.RAF){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(e)return n._timerId=e(t==n.RAF?n._handleRAF:n._handleSynch),void(n._raf=!0)}n._raf=!1,n._timerId=setTimeout(n._handleTimeout,n._interval)}},n._tick=function(){var t,e,i=n.paused,s=n._getTime(),r=s-n._lastTime;for(n._lastTime=s,n._ticks++,i&&(n._pausedTicks++,n._pausedTime+=r),n.hasEventListener("tick")&&(t=new createjs.Event("tick"),e=n.maxDelta,t.delta=e&&e<r?e:r,t.paused=i,t.time=s,t.runTime=s-n._pausedTime,n.dispatchEvent(t)),n._tickTimes.unshift(n._getTime()-s);100<n._tickTimes.length;)n._tickTimes.pop();for(n._times.unshift(s);100<n._times.length;)n._times.pop()};var t=window,e=t.performance.now||t.performance.mozNow||t.performance.msNow||t.performance.oNow||t.performance.webkitNow;n._getTime=function(){return(e&&e.call(t.performance)||(new Date).getTime())-n._startTime},createjs.Ticker=n}(),function(){"use strict";function t(t){this.readyState=t.readyState,this._video=t,this._canvas=null,this._lastTime=-1,this.readyState<2&&t.addEventListener("canplaythrough",this._videoReady.bind(this))}var e=t.prototype;e.getImage=function(){if(!(this.readyState<2)){var t,e=this._canvas,i=this._video;return e||((e=this._canvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")).width=i.videoWidth,e.height=i.videoHeight),2<=i.readyState&&i.currentTime!==this._lastTime&&((t=e.getContext("2d")).clearRect(0,0,e.width,e.height),t.drawImage(i,0,0,e.width,e.height),this._lastTime=i.currentTime),e}},e._videoReady=function(){this.readyState=2},createjs.VideoBuffer=t}(),function(){"use strict";function t(t,e,i,s,r,n,a,o,h,c,u){this.Event_constructor(t,e,i),this.stageX=s,this.stageY=r,this.rawX=null==h?s:h,this.rawY=null==c?r:c,this.nativeEvent=n,this.pointerID=a,this.primary=!!o,this.relatedTarget=u}var e=createjs.extend(t,createjs.Event);e._get_localX=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).x},e._get_localY=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).y},e._get_isTouch=function(){return-1!==this.pointerID};try{Object.defineProperties(e,{localX:{get:e._get_localX},localY:{get:e._get_localY},isTouch:{get:e._get_isTouch}})}catch(t){}e.clone=function(){return new t(this.type,this.bubbles,this.cancelable,this.stageX,this.stageY,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)},e.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"},createjs.MouseEvent=createjs.promote(t,"Event")}(),function(){"use strict";function l(t,e,i,s,r,n){this.setValues(t,e,i,s,r,n)}var t=l.prototype;l.DEG_TO_RAD=Math.PI/180,l.identity=null,t.setValues=function(t,e,i,s,r,n){return this.a=null==t?1:t,this.b=e||0,this.c=i||0,this.d=null==s?1:s,this.tx=r||0,this.ty=n||0,this},t.append=function(t,e,i,s,r,n){var a=this.a,o=this.b,h=this.c,c=this.d;return 1==t&&0==e&&0==i&&1==s||(this.a=a*t+h*e,this.b=o*t+c*e,this.c=a*i+h*s,this.d=o*i+c*s),this.tx=a*r+h*n+this.tx,this.ty=o*r+c*n+this.ty,this},t.prepend=function(t,e,i,s,r,n){var a=this.a,o=this.c,h=this.tx;return this.a=t*a+i*this.b,this.b=e*a+s*this.b,this.c=t*o+i*this.d,this.d=e*o+s*this.d,this.tx=t*h+i*this.ty+r,this.ty=e*h+s*this.ty+n,this},t.appendMatrix=function(t){return this.append(t.a,t.b,t.c,t.d,t.tx,t.ty)},t.prependMatrix=function(t){return this.prepend(t.a,t.b,t.c,t.d,t.tx,t.ty)},t.appendTransform=function(t,e,i,s,r,n,a,o,h){var c,u=r%360?(u=r*l.DEG_TO_RAD,c=Math.cos(u),Math.sin(u)):(c=1,0);return n||a?(n*=l.DEG_TO_RAD,a*=l.DEG_TO_RAD,this.append(Math.cos(a),Math.sin(a),-Math.sin(n),Math.cos(n),t,e),this.append(c*i,u*i,-u*s,c*s,0,0)):this.append(c*i,u*i,-u*s,c*s,t,e),(o||h)&&(this.tx-=o*this.a+h*this.c,this.ty-=o*this.b+h*this.d),this},t.prependTransform=function(t,e,i,s,r,n,a,o,h){var c,u=r%360?(u=r*l.DEG_TO_RAD,c=Math.cos(u),Math.sin(u)):(c=1,0);return(o||h)&&(this.tx-=o,this.ty-=h),n||a?(n*=l.DEG_TO_RAD,a*=l.DEG_TO_RAD,this.prepend(c*i,u*i,-u*s,c*s,0,0),this.prepend(Math.cos(a),Math.sin(a),-Math.sin(n),Math.cos(n),t,e)):this.prepend(c*i,u*i,-u*s,c*s,t,e),this},t.rotate=function(t){t*=l.DEG_TO_RAD;var e=Math.cos(t),i=Math.sin(t),s=this.a,t=this.b;return this.a=s*e+this.c*i,this.b=t*e+this.d*i,this.c=-s*i+this.c*e,this.d=-t*i+this.d*e,this},t.skew=function(t,e){return t*=l.DEG_TO_RAD,e*=l.DEG_TO_RAD,this.append(Math.cos(e),Math.sin(e),-Math.sin(t),Math.cos(t),0,0),this},t.scale=function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this},t.translate=function(t,e){return this.tx+=this.a*t+this.c*e,this.ty+=this.b*t+this.d*e,this},t.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},t.invert=function(){var t=this.a,e=this.b,i=this.c,s=this.d,r=this.tx,n=t*s-e*i;return this.a=s/n,this.b=-e/n,this.c=-i/n,this.d=t/n,this.tx=(i*this.ty-s*r)/n,this.ty=-(t*this.ty-e*r)/n,this},t.isIdentity=function(){return 0===this.tx&&0===this.ty&&1===this.a&&0===this.b&&0===this.c&&1===this.d},t.equals=function(t){return this.tx===t.tx&&this.ty===t.ty&&this.a===t.a&&this.b===t.b&&this.c===t.c&&this.d===t.d},t.transformPoint=function(t,e,i){return(i=i||{}).x=t*this.a+e*this.c+this.tx,i.y=t*this.b+e*this.d+this.ty,i},t.decompose=function(t){null==t&&(t={}),t.x=this.tx,t.y=this.ty,t.scaleX=Math.sqrt(this.a*this.a+this.b*this.b),t.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var e=Math.atan2(-this.c,this.d),i=Math.atan2(this.b,this.a);return Math.abs(1-e/i)<1e-5?(t.rotation=i/l.DEG_TO_RAD,this.a<0&&0<=this.d&&(t.rotation+=t.rotation<=0?180:-180),t.skewX=t.skewY=0):(t.skewX=e/l.DEG_TO_RAD,t.skewY=i/l.DEG_TO_RAD),t},t.copy=function(t){return this.setValues(t.a,t.b,t.c,t.d,t.tx,t.ty)},t.clone=function(){return new l(this.a,this.b,this.c,this.d,this.tx,this.ty)},t.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"},l.identity=new l,createjs.Matrix2D=l}(),function(){"use strict";function t(t,e,i,s,r){this.setValues(t,e,i,s,r)}var e=t.prototype;e.setValues=function(t,e,i,s,r){return this.visible=null==t||!!t,this.alpha=null==e?1:e,this.shadow=i,this.compositeOperation=s,this.matrix=r||this.matrix&&this.matrix.identity()||new createjs.Matrix2D,this},e.append=function(t,e,i,s,r){return this.alpha*=e,this.shadow=i||this.shadow,this.compositeOperation=s||this.compositeOperation,this.visible=this.visible&&t,r&&this.matrix.appendMatrix(r),this},e.prepend=function(t,e,i,s,r){return this.alpha*=e,this.shadow=this.shadow||i,this.compositeOperation=this.compositeOperation||s,this.visible=this.visible&&t,r&&this.matrix.prependMatrix(r),this},e.identity=function(){return this.visible=!0,this.alpha=1,this.shadow=this.compositeOperation=null,this.matrix.identity(),this},e.clone=function(){return new t(this.alpha,this.shadow,this.compositeOperation,this.visible,this.matrix.clone())},createjs.DisplayProps=t}(),function(){"use strict";function t(t,e){this.setValues(t,e)}var e=t.prototype;e.setValues=function(t,e){return this.x=t||0,this.y=e||0,this},e.copy=function(t){return this.x=t.x,this.y=t.y,this},e.subtract=function(t){return new createjs.Point(this.x-t.x,this.y-t.y)},e.add=function(t){return new createjs.Point(this.x+t.x,this.y+t.y)},e.angle=function(t){return null==t?Math.atan2(this.y,this.x):t.subtract(this).angle()},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.distance=function(t){return t.subtract(this).length()},e.project=function(t,e){return new createjs.Point(this.x+Math.cos(t)*e,this.y+Math.sin(t)*e)},e.interpolate=function(t,e){return new createjs.Point(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},e.average=function(t){return this.interpolate(t,.5)},e.clone=function(){return new t(this.x,this.y)},e.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"},createjs.Point=t}(),function(){"use strict";function r(t,e,i,s){this.setValues(t,e,i,s)}var t=r.prototype;t.setValues=function(t,e,i,s){return this.x=t||0,this.y=e||0,this.width=i||0,this.height=s||0,this},t.extend=function(t,e,i,s){return s=s||0,t+(i=i||0)>this.x+this.width&&(this.width=t+i-this.x),e+s>this.y+this.height&&(this.height=e+s-this.y),t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),this},t.pad=function(t,e,i,s){return this.x-=e,this.y-=t,this.width+=e+s,this.height+=t+i,this},t.copy=function(t){return this.setValues(t.x,t.y,t.width,t.height)},t.contains=function(t,e,i,s){return i=i||0,s=s||0,t>=this.x&&t+i<=this.x+this.width&&e>=this.y&&e+s<=this.y+this.height},t.union=function(t){return this.clone().extend(t.x,t.y,t.width,t.height)},t.intersection=function(t){var e=t.x,i=t.y,s=e+t.width,t=i+t.height;return this.x>e&&(e=this.x),this.y>i&&(i=this.y),this.x+this.width<s&&(s=this.x+this.width),this.y+this.height<t&&(t=this.y+this.height),s<=e||t<=i?null:new r(e,i,s-e,t-i)},t.intersects=function(t){return t.x<=this.x+this.width&&this.x<=t.x+t.width&&t.y<=this.y+this.height&&this.y<=t.y+t.height},t.isEmpty=function(){return this.width<=0||this.height<=0},t.clone=function(){return new r(this.x,this.y,this.width,this.height)},t.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"},createjs.Rectangle=r}(),function(){"use strict";function t(t,e,i,s,r,n,a){t.addEventListener&&(this.target=t,this.overLabel=null==i?"over":i,this.outLabel=null==e?"out":e,this.downLabel=null==s?"down":s,this.play=r,this._isPressed=!1,this._isOver=!1,this._enabled=!1,t.mouseChildren=!1,this.enabled=!0,this.handleEvent({}),n&&(a&&(n.actionsEnabled=!1,n.gotoAndStop&&n.gotoAndStop(a)),t.hitArea=n))}var e=t.prototype;e._setEnabled=function(t){var e;t!=this._enabled&&(e=this.target,(this._enabled=t)?(e.cursor="pointer",e.addEventListener("rollover",this),e.addEventListener("rollout",this),e.addEventListener("mousedown",this),e.addEventListener("pressup",this),e._reset&&(e.__reset=e._reset,e._reset=this._reset)):(e.cursor=null,e.removeEventListener("rollover",this),e.removeEventListener("rollout",this),e.removeEventListener("mousedown",this),e.removeEventListener("pressup",this),e.__reset&&(e._reset=e.__reset,delete e.__reset)))},e.setEnabled=createjs.deprecate(e._setEnabled,"ButtonHelper.setEnabled"),e._getEnabled=function(){return this._enabled},e.getEnabled=createjs.deprecate(e._getEnabled,"ButtonHelper.getEnabled");try{Object.defineProperties(e,{enabled:{get:e._getEnabled,set:e._setEnabled}})}catch(t){}e.toString=function(){return"[ButtonHelper]"},e.handleEvent=function(t){var e=this.target,t=t.type,t="mousedown"==t?(this._isPressed=!0,this.downLabel):"pressup"==t?(this._isPressed=!1,this._isOver?this.overLabel:this.outLabel):"rollover"==t?(this._isOver=!0,this._isPressed?this.downLabel:this.overLabel):(this._isOver=!1,this._isPressed?this.overLabel:this.outLabel);this.play?e.gotoAndPlay&&e.gotoAndPlay(t):e.gotoAndStop&&e.gotoAndStop(t)},e._reset=function(){var t=this.paused;this.__reset(),this.paused=t},createjs.ButtonHelper=t}(),function(){"use strict";function t(t,e,i,s){this.color=t||"black",this.offsetX=e||0,this.offsetY=i||0,this.blur=s||0}var e=t.prototype;t.identity=new t("transparent",0,0,0),e.toString=function(){return"[Shadow]"},e.clone=function(){return new t(this.color,this.offsetX,this.offsetY,this.blur)},createjs.Shadow=t}(),function(){"use strict";function t(t){this.EventDispatcher_constructor(),this.complete=!0,this.framerate=0,this._animations=null,this._frames=null,this._images=null,this._data=null,this._loadCount=0,this._frameHeight=0,this._frameWidth=0,this._numFrames=0,this._regX=0,this._regY=0,this._spacing=0,this._margin=0,this._parseData(t)}var e=createjs.extend(t,createjs.EventDispatcher);e._getAnimations=function(){return this._animations.slice()},e.getAnimations=createjs.deprecate(e._getAnimations,"SpriteSheet.getAnimations");try{Object.defineProperties(e,{animations:{get:e._getAnimations}})}catch(t){}e.getNumFrames=function(t){if(null==t)return this._frames?this._frames.length:this._numFrames||0;t=this._data[t];return null==t?0:t.frames.length},e.getAnimation=function(t){return this._data[t]},e.getFrame=function(t){var e;return this._frames&&(e=this._frames[t])?e:null},e.getFrameBounds=function(t,e){t=this.getFrame(t);return t?(e||new createjs.Rectangle).setValues(-t.regX,-t.regY,t.rect.width,t.rect.height):null},e.toString=function(){return"[SpriteSheet]"},e.clone=function(){throw"SpriteSheet cannot be cloned."},e._parseData=function(t){var e,i,s,r;if(null!=t){if(this.framerate=t.framerate||0,t.images&&0<(i=t.images.length))for(l=this._images=[],e=0;e<i;e++){var n,a=t.images[e];"string"==typeof a&&(n=a,(a=document.createElement("img")).src=n),l.push(a),a.getContext||a.naturalWidth||(this._loadCount++,this.complete=!1,function(t,e){a.onload=function(){t._handleImageLoad(e)}}(this,n),function(t,e){a.onerror=function(){t._handleImageError(e)}}(this,n))}if(null!=t.frames)if(Array.isArray(t.frames))for(this._frames=[],e=0,i=(l=t.frames).length;e<i;e++){var o=l[e];this._frames.push({image:this._images[o[4]||0],rect:new createjs.Rectangle(o[0],o[1],o[2],o[3]),regX:o[5]||0,regY:o[6]||0})}else s=t.frames,this._frameWidth=s.width,this._frameHeight=s.height,this._regX=s.regX||0,this._regY=s.regY||0,this._spacing=s.spacing||0,this._margin=s.margin||0,this._numFrames=s.count,0==this._loadCount&&this._calculateFrames();if(this._animations=[],null!=(s=t.animations))for(r in this._data={},s){var h={name:r},c=s[r];if("number"==typeof c)l=h.frames=[c];else if(Array.isArray(c))if(1==c.length)h.frames=[c[0]];else for(h.speed=c[3],h.next=c[2],l=h.frames=[],e=c[0];e<=c[1];e++)l.push(e);else{h.speed=c.speed,h.next=c.next;var u=c.frames,l=h.frames="number"==typeof u?[u]:u.slice(0)}!0!==h.next&&void 0!==h.next||(h.next=r),(!1===h.next||l.length<2&&h.next==r)&&(h.next=null),h.speed||(h.speed=1),this._animations.push(r),this._data[r]=h}}},e._handleImageLoad=function(t){0==--this._loadCount&&(this._calculateFrames(),this.complete=!0,this.dispatchEvent("complete"))},e._handleImageError=function(t){var e=new createjs.Event("error");e.src=t,this.dispatchEvent(e),0==--this._loadCount&&this.dispatchEvent("complete")},e._calculateFrames=function(){if(!this._frames&&0!=this._frameWidth){this._frames=[];var t=this._numFrames||1e5,e=0,i=this._frameWidth,s=this._frameHeight,r=this._spacing,n=this._margin;t:for(var a=0,o=this._images;a<o.length;a++)for(var h=o[a],c=h.width||h.naturalWidth,u=h.height||h.naturalHeight,l=n;l<=u-n-s;){for(var d=n;d<=c-n-i;){if(t<=e)break t;e++,this._frames.push({image:h,rect:new createjs.Rectangle(d,l,i,s),regX:this._regX,regY:this._regY}),d+=i+r}l+=s+r}this._numFrames=e}},createjs.SpriteSheet=createjs.promote(t,"EventDispatcher")}(),function(){"use strict";function v(){this.command=null,this._stroke=null,this._strokeStyle=null,this._oldStrokeStyle=null,this._strokeDash=null,this._oldStrokeDash=null,this._strokeIgnoreScale=!1,this._fill=null,this._instructions=[],this._commitIndex=0,this._activeInstructions=[],this._dirty=!1,this._storeIndex=0,this.clear()}var t=v.prototype,h=v;v.getRGB=function(t,e,i,s){return null!=t&&null==i&&(s=e,i=255&t,e=t>>8&255,t=t>>16&255),null==s?"rgb("+t+","+e+","+i+")":"rgba("+t+","+e+","+i+","+s+")"},v.getHSL=function(t,e,i,s){return null==s?"hsl("+t%360+","+e+"%,"+i+"%)":"hsla("+t%360+","+e+"%,"+i+"%,"+s+")"},v.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},v.STROKE_CAPS_MAP=["butt","round","square"],v.STROKE_JOINTS_MAP=["miter","round","bevel"];var e=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");e.getContext&&(v._ctx=e.getContext("2d"),e.width=e.height=1),t._getInstructions=function(){return this._updateInstructions(),this._instructions},t.getInstructions=createjs.deprecate(t._getInstructions,"Graphics.getInstructions");try{Object.defineProperties(t,{instructions:{get:t._getInstructions}})}catch(t){}t.isEmpty=function(){return!(this._instructions.length||this._activeInstructions.length)},t.draw=function(t,e){this._updateInstructions();for(var i=this._instructions,s=this._storeIndex,r=i.length;s<r;s++)i[s].exec(t,e)},t.drawAsPath=function(t){this._updateInstructions();for(var e,i=this._instructions,s=this._storeIndex,r=i.length;s<r;s++)!1!==(e=i[s]).path&&e.exec(t)},t.moveTo=function(t,e){return this.append(new h.MoveTo(t,e),!0)},t.lineTo=function(t,e){return this.append(new h.LineTo(t,e))},t.arcTo=function(t,e,i,s,r){return this.append(new h.ArcTo(t,e,i,s,r))},t.arc=function(t,e,i,s,r,n){return this.append(new h.Arc(t,e,i,s,r,n))},t.quadraticCurveTo=function(t,e,i,s){return this.append(new h.QuadraticCurveTo(t,e,i,s))},t.bezierCurveTo=function(t,e,i,s,r,n){return this.append(new h.BezierCurveTo(t,e,i,s,r,n))},t.rect=function(t,e,i,s){return this.append(new h.Rect(t,e,i,s))},t.closePath=function(){return this._activeInstructions.length?this.append(new h.ClosePath):this},t.clear=function(){return this._instructions.length=this._activeInstructions.length=this._commitIndex=0,this._strokeStyle=this._oldStrokeStyle=this._stroke=this._fill=this._strokeDash=this._oldStrokeDash=null,this._dirty=this._strokeIgnoreScale=!1,this},t.beginFill=function(t){return this._setFill(t?new h.Fill(t):null)},t.beginLinearGradientFill=function(t,e,i,s,r,n){return this._setFill((new h.Fill).linearGradient(t,e,i,s,r,n))},t.beginRadialGradientFill=function(t,e,i,s,r,n,a,o){return this._setFill((new h.Fill).radialGradient(t,e,i,s,r,n,a,o))},t.beginBitmapFill=function(t,e,i){return this._setFill(new h.Fill(null,i).bitmap(t,e))},t.endFill=function(){return this.beginFill()},t.setStrokeStyle=function(t,e,i,s,r){return this._updateInstructions(!0),this._strokeStyle=this.command=new h.StrokeStyle(t,e,i,s,r),this._stroke&&(this._stroke.ignoreScale=r),this._strokeIgnoreScale=r,this},t.setStrokeDash=function(t,e){return this._updateInstructions(!0),this._strokeDash=this.command=new h.StrokeDash(t,e),this},t.beginStroke=function(t){return this._setStroke(t?new h.Stroke(t):null)},t.beginLinearGradientStroke=function(t,e,i,s,r,n){return this._setStroke((new h.Stroke).linearGradient(t,e,i,s,r,n))},t.beginRadialGradientStroke=function(t,e,i,s,r,n,a,o){return this._setStroke((new h.Stroke).radialGradient(t,e,i,s,r,n,a,o))},t.beginBitmapStroke=function(t,e){return this._setStroke((new h.Stroke).bitmap(t,e))},t.endStroke=function(){return this.beginStroke()},t.curveTo=t.quadraticCurveTo,t.drawRect=t.rect,t.drawRoundRect=function(t,e,i,s,r){return this.drawRoundRectComplex(t,e,i,s,r,r,r,r)},t.drawRoundRectComplex=function(t,e,i,s,r,n,a,o){return this.append(new h.RoundRect(t,e,i,s,r,n,a,o))},t.drawCircle=function(t,e,i){return this.append(new h.Circle(t,e,i))},t.drawEllipse=function(t,e,i,s){return this.append(new h.Ellipse(t,e,i,s))},t.drawPolyStar=function(t,e,i,s,r,n){return this.append(new h.PolyStar(t,e,i,s,r,n))},t.drawPolygon=function(t,e){return this.append(new h.Polygon(t,e))},t.append=function(t,e){return this._activeInstructions.push(t),this.command=t,e||(this._dirty=!0),this},t.decodePath=function(t){for(var e=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo,this.closePath],i=[2,2,4,6,0],s=0,r=t.length,n=[],a=0,o=0,h=v.BASE_64;s<r;){var c=t.charAt(s),u=h[c],l=u>>3,d=e[l];if(!d||3&u)throw"bad path data (@"+s+"): "+c;var _=i[l];l||(a=o=0),s++;for(var p=2+(u>>2&1),f=n.length=0;f<_;f++){var g=(m=h[t.charAt(s)])>>5?-1:1,m=(31&m)<<6|h[t.charAt(s+1)];3==p&&(m=m<<6|h[t.charAt(s+2)]),m=g*m/10,f%2?a=m+=a:o=m+=o,n[f]=m,s+=p}d.apply(this,n)}return this},t.store=function(){return this._updateInstructions(!0),this._storeIndex=this._instructions.length,this},t.unstore=function(){return this._storeIndex=0,this},t.clone=function(){var t=new v;return t.command=this.command,t._stroke=this._stroke,t._strokeStyle=this._strokeStyle,t._strokeDash=this._strokeDash,t._strokeIgnoreScale=this._strokeIgnoreScale,t._fill=this._fill,t._instructions=this._instructions.slice(),t._commitIndex=this._commitIndex,t._activeInstructions=this._activeInstructions.slice(),t._dirty=this._dirty,t._storeIndex=this._storeIndex,t},t.toString=function(){return"[Graphics]"},t.mt=t.moveTo,t.lt=t.lineTo,t.at=t.arcTo,t.bt=t.bezierCurveTo,t.qt=t.quadraticCurveTo,t.a=t.arc,t.r=t.rect,t.cp=t.closePath,t.c=t.clear,t.f=t.beginFill,t.lf=t.beginLinearGradientFill,t.rf=t.beginRadialGradientFill,t.bf=t.beginBitmapFill,t.ef=t.endFill,t.ss=t.setStrokeStyle,t.sd=t.setStrokeDash,t.s=t.beginStroke,t.ls=t.beginLinearGradientStroke,t.rs=t.beginRadialGradientStroke,t.bs=t.beginBitmapStroke,t.es=t.endStroke,t.dr=t.drawRect,t.rr=t.drawRoundRect,t.rc=t.drawRoundRectComplex,t.dc=t.drawCircle,t.de=t.drawEllipse,t.dp=t.drawPolyStar,t.pg=t.drawPolygon,t.p=t.decodePath,t._updateInstructions=function(t){var e=this._instructions,i=this._activeInstructions,s=this._commitIndex;if(this._dirty&&i.length){e.length=s,e.push(v.beginCmd);var r=i.length,n=e.length;e.length=n+r;for(var a=0;a<r;a++)e[a+n]=i[a];this._fill&&e.push(this._fill),this._stroke&&(this._strokeDash!==this._oldStrokeDash&&e.push(this._strokeDash),this._strokeStyle!==this._oldStrokeStyle&&e.push(this._strokeStyle),t&&(this._oldStrokeStyle=this._strokeStyle,this._oldStrokeDash=this._strokeDash),e.push(this._stroke)),this._dirty=!1}t&&(i.length=0,this._commitIndex=e.length)},t._setFill=function(t){return this._updateInstructions(!0),this.command=this._fill=t,this},t._setStroke=function(t){return this._updateInstructions(!0),(this.command=this._stroke=t)&&(t.ignoreScale=this._strokeIgnoreScale),this},(h.LineTo=function(t,e){this.x=t,this.y=e}).prototype.exec=function(t){t.lineTo(this.x,this.y)},(h.MoveTo=function(t,e){this.x=t,this.y=e}).prototype.exec=function(t){t.moveTo(this.x,this.y)},(h.ArcTo=function(t,e,i,s,r){this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.radius=r}).prototype.exec=function(t){t.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)},(h.Arc=function(t,e,i,s,r,n){this.x=t,this.y=e,this.radius=i,this.startAngle=s,this.endAngle=r,this.anticlockwise=!!n}).prototype.exec=function(t){t.arc(this.x,this.y,this.radius,this.startAngle,this.endAngle,this.anticlockwise)},(h.QuadraticCurveTo=function(t,e,i,s){this.cpx=t,this.cpy=e,this.x=i,this.y=s}).prototype.exec=function(t){t.quadraticCurveTo(this.cpx,this.cpy,this.x,this.y)},(h.BezierCurveTo=function(t,e,i,s,r,n){this.cp1x=t,this.cp1y=e,this.cp2x=i,this.cp2y=s,this.x=r,this.y=n}).prototype.exec=function(t){t.bezierCurveTo(this.cp1x,this.cp1y,this.cp2x,this.cp2y,this.x,this.y)},(h.Rect=function(t,e,i,s){this.x=t,this.y=e,this.w=i,this.h=s}).prototype.exec=function(t){t.rect(this.x,this.y,this.w,this.h)},(h.ClosePath=function(){}).prototype.exec=function(t){t.closePath()},(h.BeginPath=function(){}).prototype.exec=function(t){t.beginPath()},(t=(h.Fill=function(t,e){this.style=t,this.matrix=e}).prototype).exec=function(t){var e;this.style&&(t.fillStyle=this.style,(e=this.matrix)&&(t.save(),t.transform(e.a,e.b,e.c,e.d,e.tx,e.ty)),t.fill(),e&&t.restore())},t.linearGradient=function(t,e,i,s,r,n){for(var a=this.style=v._ctx.createLinearGradient(i,s,r,n),o=0,h=t.length;o<h;o++)a.addColorStop(e[o],t[o]);return a.props={colors:t,ratios:e,x0:i,y0:s,x1:r,y1:n,type:"linear"},this},t.radialGradient=function(t,e,i,s,r,n,a,o){for(var h=this.style=v._ctx.createRadialGradient(i,s,r,n,a,o),c=0,u=t.length;c<u;c++)h.addColorStop(e[c],t[c]);return h.props={colors:t,ratios:e,x0:i,y0:s,r0:r,x1:n,y1:a,r1:o,type:"radial"},this},t.bitmap=function(t,e,i){return i&&(this.matrix=i),(t.naturalWidth||t.getContext||2<=t.readyState)&&((this.style=v._ctx.createPattern(t,e||"")).props={image:t,repetition:e,type:"bitmap"}),this},t.path=!1,(t=(h.Stroke=function(t,e){this.style=t,this.ignoreScale=e}).prototype).exec=function(t){this.style&&(t.strokeStyle=this.style,this.ignoreScale&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.stroke(),this.ignoreScale&&t.restore())},t.linearGradient=h.Fill.prototype.linearGradient,t.radialGradient=h.Fill.prototype.radialGradient,t.bitmap=h.Fill.prototype.bitmap,t.path=!1,(t=(h.StrokeStyle=function(t,e,i,s,r){this.width=t,this.caps=e,this.joints=i,this.miterLimit=s,this.ignoreScale=r}).prototype).exec=function(t){t.lineWidth=null==this.width?"1":this.width,t.lineCap=null==this.caps?"butt":isNaN(this.caps)?this.caps:v.STROKE_CAPS_MAP[this.caps],t.lineJoin=null==this.joints?"miter":isNaN(this.joints)?this.joints:v.STROKE_JOINTS_MAP[this.joints],t.miterLimit=null==this.miterLimit?"10":this.miterLimit,t.ignoreScale=null!=this.ignoreScale&&this.ignoreScale},t.path=!1,(h.StrokeDash=function(t,e){this.segments=t,this.offset=e||0}).prototype.exec=function(t){t.setLineDash&&(t.setLineDash(this.segments||h.StrokeDash.EMPTY_SEGMENTS),t.lineDashOffset=this.offset||0)},h.StrokeDash.EMPTY_SEGMENTS=[],(h.RoundRect=function(t,e,i,s,r,n,a,o){this.x=t,this.y=e,this.w=i,this.h=s,this.radiusTL=r,this.radiusTR=n,this.radiusBR=a,this.radiusBL=o}).prototype.exec=function(t){var e=(h<c?h:c)/2,i=0,s=0,r=0,n=0,a=this.x,o=this.y,h=this.w,c=this.h,u=this.radiusTL,l=this.radiusTR,d=this.radiusBR,_=this.radiusBL;u<0&&(u*=i=-1),e<u&&(u=e),l<0&&(l*=s=-1),e<l&&(l=e),d<0&&(d*=r=-1),e<d&&(d=e),_<0&&(_*=n=-1),e<_&&(_=e),t.moveTo(a+h-l,o),t.arcTo(a+h+l*s,o-l*s,a+h,o+l,l),t.lineTo(a+h,o+c-d),t.arcTo(a+h+d*r,o+c+d*r,a+h-d,o+c,d),t.lineTo(a+_,o+c),t.arcTo(a-_*n,o+c+_*n,a,o+c-_,_),t.lineTo(a,o+u),t.arcTo(a-u*i,o-u*i,a+u,o,u),t.closePath()},(h.Circle=function(t,e,i){this.x=t,this.y=e,this.radius=i}).prototype.exec=function(t){t.arc(this.x,this.y,this.radius,0,2*Math.PI)},(h.Ellipse=function(t,e,i,s){this.x=t,this.y=e,this.w=i,this.h=s}).prototype.exec=function(t){var e=this.x,i=this.y,s=this.w,r=this.h,n=s/2*.5522848,a=r/2*.5522848,o=e+s,h=i+r,s=e+s/2,r=i+r/2;t.moveTo(e,r),t.bezierCurveTo(e,r-a,s-n,i,s,i),t.bezierCurveTo(s+n,i,o,r-a,o,r),t.bezierCurveTo(o,r+a,s+n,h,s,h),t.bezierCurveTo(s-n,h,e,r+a,e,r)},(h.PolyStar=function(t,e,i,s,r,n){this.x=t,this.y=e,this.radius=i,this.sides=s,this.pointSize=r,this.angle=n}).prototype.exec=function(t){var e=this.x,i=this.y,s=this.radius,r=(this.angle||0)/180*Math.PI,n=this.sides,a=1-(this.pointSize||0),o=Math.PI/n;t.moveTo(e+Math.cos(r)*s,i+Math.sin(r)*s);for(var h=0;h<n+1&&(r+=o,1==a||(t.lineTo(e+Math.cos(r)*s*a,i+Math.sin(r)*s*a),h!=n));h++)r+=o,t.lineTo(e+Math.cos(r)*s,i+Math.sin(r)*s);t.closePath()},(h.Polygon=function(t,e){this.points=t,null==e&&(e=!0),this.close=e}).prototype.exec=function(t){var e,i,s=this.points,r=this.close,n=s[0];t.moveTo(n[0],n[1]);for(var a=1;a<s.length;a++)e=s[a],1==a&&(i=[e[0],e[1]]),t.lineTo(e[0],e[1]);r&&(t.lineTo(n[0],n[1]),t.lineTo(i[0],i[1])),t.closePath()},v.beginCmd=new h.BeginPath,createjs.Graphics=v}(),function(){"use strict";function n(){this.EventDispatcher_constructor(),this.alpha=1,this.cacheCanvas=null,this.bitmapCache=null,this.id=createjs.UID.get(),this.mouseEnabled=!0,this.tickEnabled=!0,this.name=null,this.parent=null,this.regX=0,this.regY=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.skewX=0,this.skewY=0,this.shadow=null,this.visible=!0,this.x=0,this.y=0,this.transformMatrix=null,this.compositeOperation=null,this.snapToPixel=!0,this.filters=null,this.mask=null,this.hitArea=null,this.cursor=null,this._props=new createjs.DisplayProps,this._rectangle=new createjs.Rectangle,this._bounds=null,this._webGLRenderStyle=n._StageGL_NONE}var t=createjs.extend(n,createjs.EventDispatcher);n._MOUSE_EVENTS=["click","dblclick","mousedown","mouseout","mouseover","pressmove","pressup","rollout","rollover"],n.suppressCrossDomainErrors=!1,n._snapToPixelEnabled=!1,n._StageGL_NONE=0,n._StageGL_SPRITE=1,n._StageGL_BITMAP=2;var e=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");e.getContext&&(n._hitTestCanvas=e,n._hitTestContext=e.getContext("2d",createjs.willReadFrequently?{willReadFrequently:!0}:void 0),e.width=e.height=1),t._getStage=function(){for(var t=this,e=createjs.Stage;t.parent;)t=t.parent;return t instanceof e?t:null},t.getStage=createjs.deprecate(t._getStage,"DisplayObject.getStage");try{Object.defineProperties(t,{stage:{get:t._getStage},cacheID:{get:function(){return this.bitmapCache&&this.bitmapCache.cacheID},set:function(t){this.bitmapCache&&(this.bitmapCache.cacheID=t)}},scale:{get:function(){return this.scaleX},set:function(t){this.scaleX=this.scaleY=t}}})}catch(t){}t.isVisible=function(){return!!(this.visible&&0<this.alpha&&0!=this.scaleX&&0!=this.scaleY)},t.draw=function(t,e){var i=this.bitmapCache;return!(!i||e)&&i.draw(t)},t.updateContext=function(t){var e=this,i=e.mask,s=e._props.matrix;i&&i.graphics&&!i.graphics.isEmpty()&&(i.getMatrix(s),t.transform(s.a,s.b,s.c,s.d,s.tx,s.ty),i.graphics.drawAsPath(t),t.clip(),s.invert(),t.transform(s.a,s.b,s.c,s.d,s.tx,s.ty)),this.getMatrix(s);var r=s.tx,i=s.ty;n._snapToPixelEnabled&&e.snapToPixel&&(r=r+(r<0?-.5:.5)|0,i=i+(i<0?-.5:.5)|0),t.transform(s.a,s.b,s.c,s.d,r,i),t.globalAlpha*=e.alpha,e.compositeOperation&&(t.globalCompositeOperation=e.compositeOperation),e.shadow&&this._applyShadow(t,e.shadow)},t.cache=function(t,e,i,s,r,n,a,o){this.bitmapCache||(this.bitmapCache=new createjs.BitmapCache),this.bitmapCache.define(this,t,e,i,s,r,n,a,o)},t.updateCache=function(t,e){if(!this.bitmapCache)throw"cache() must be called before updateCache()";this.bitmapCache.update(t,e)},t.uncache=function(){this.bitmapCache&&(this.bitmapCache.release(),this.bitmapCache=void 0)},t.getCacheDataURL=function(){return this.bitmapCache?this.bitmapCache.getCacheDataURL():null},t.localToGlobal=function(t,e,i){i=this.getConcatenatedMatrix(this._props.matrix).transformPoint(t,e,i||new createjs.Point);return this.stage&&createjs.stageTransformable&&(i=this.stage.getConcatenatedMatrix(this._mtx).invert().transformPoint(i.x,i.y)),i},t.globalToLocal=function(t,e,i){var s;return this.stage&&createjs.stageTransformable&&(t=(s=this.stage.getConcatenatedMatrix(this._mtx).transformPoint(t,e)).x,e=s.y),this.getConcatenatedMatrix(this._props.matrix).invert().transformPoint(t,e,i||new createjs.Point)},t.localToLocal=function(t,e,i,s){return s=this.localToGlobal(t,e,s),i.globalToLocal(s.x,s.y,s)},t.setTransform=function(t,e,i,s,r,n,a,o,h){return this.x=t||0,this.y=e||0,this.scaleX=null==i?1:i,this.scaleY=null==s?1:s,this.rotation=r||0,this.skewX=n||0,this.skewY=a||0,this.regX=o||0,this.regY=h||0,this},t.getMatrix=function(t){var e=this,t=t&&t.identity()||new createjs.Matrix2D;return e.transformMatrix?t.copy(e.transformMatrix):t.appendTransform(e.x,e.y,e.scaleX,e.scaleY,e.rotation,e.skewX,e.skewY,e.regX,e.regY)},t.getConcatenatedMatrix=function(t){for(var e=this,i=this.getMatrix(t);e=e.parent;)i.prependMatrix(e.getMatrix(e._props.matrix));return i},t.getConcatenatedDisplayProps=function(t){t=t?t.identity():new createjs.DisplayProps;for(var e=this,i=e.getMatrix(t.matrix);t.prepend(e.visible,e.alpha,e.shadow,e.compositeOperation),e!=this&&i.prependMatrix(e.getMatrix(e._props.matrix)),e=e.parent;);return t},t.hitTest=function(t,e){var i=n._hitTestContext;i.setTransform(1,0,0,1,-t,-e),this.draw(i);e=this._testHit(i);return i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,2,2),e},t.set=function(t){for(var e in t)this[e]=t[e];return this},t.getBounds=function(){if(this._bounds)return this._rectangle.copy(this._bounds);var t=this.cacheCanvas;if(t){var e=this._cacheScale;return this._rectangle.setValues(this._cacheOffsetX,this._cacheOffsetY,t.width/e,t.height/e)}return null},t.getTransformedBounds=function(){return this._getBounds()},t.setBounds=function(t,e,i,s){this._bounds=null!=t?(this._bounds||new createjs.Rectangle).setValues(t,e,i,s):t},t.clone=function(){return this._cloneProps(new n)},t.toString=function(){return"[DisplayObject (name="+this.name+")]"},t._updateState=null,t._cloneProps=function(t){return t.alpha=this.alpha,t.mouseEnabled=this.mouseEnabled,t.tickEnabled=this.tickEnabled,t.name=this.name,t.regX=this.regX,t.regY=this.regY,t.rotation=this.rotation,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shadow=this.shadow,t.skewX=this.skewX,t.skewY=this.skewY,t.visible=this.visible,t.x=this.x,t.y=this.y,t.compositeOperation=this.compositeOperation,t.snapToPixel=this.snapToPixel,t.filters=null==this.filters?null:this.filters.slice(0),t.mask=this.mask,t.hitArea=this.hitArea,t.cursor=this.cursor,t._bounds=this._bounds,t},t._applyShadow=function(t,e){e=e||Shadow.identity,t.shadowColor=e.color,t.shadowOffsetX=e.offsetX,t.shadowOffsetY=e.offsetY,t.shadowBlur=e.blur},t._tick=function(t){var e=this._listeners;e&&e.tick&&(t.target=null,t.propagationStopped=t.immediatePropagationStopped=!1,this.dispatchEvent(t))},t._testHit=function(t){try{var e=1<t.getImageData(0,0,1,1).data[3]}catch(t){if(!n.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 e},t._getBounds=function(t,e){return this._transformBounds(this.getBounds(),t,e)},t._transformBounds=function(t,e,i){if(!t)return t;var s=t.x,r=t.y,n=t.width,a=t.height,o=this._props.matrix,o=i?o.identity():this.getMatrix(o);(s||r)&&o.appendTransform(0,0,1,1,0,0,0,-s,-r),e&&o.prependMatrix(e);var h=n*o.a,c=n*o.b,u=a*o.c,l=a*o.d,d=o.tx,i=o.ty,e=d,n=d,a=i,o=i;return(s=h+d)<e?e=s:n<s&&(n=s),(s=h+u+d)<e?e=s:n<s&&(n=s),(s=u+d)<e?e=s:n<s&&(n=s),(r=c+i)<a?a=r:o<r&&(o=r),(r=c+l+i)<a?a=r:o<r&&(o=r),(r=l+i)<a?a=r:o<r&&(o=r),t.setValues(e,a,n-e,o-a)},t._hasMouseEventListener=function(){for(var t=n._MOUSE_EVENTS,e=0,i=t.length;e<i;e++)if(this.hasEventListener(t[e]))return!0;return!!this.cursor},createjs.DisplayObject=createjs.promote(n,"EventDispatcher")}(),function(){"use strict";function g(){this.DisplayObject_constructor(),this.children=[],this.mouseChildren=!0,this.tickChildren=!0}var t=createjs.extend(g,createjs.DisplayObject);t._getNumChildren=function(){return this.children.length},t.getNumChildren=createjs.deprecate(t._getNumChildren,"Container.getNumChildren");try{Object.defineProperties(t,{numChildren:{get:t._getNumChildren}})}catch(t){}t.initialize=g,t.isVisible=function(){var t=this.cacheCanvas||this.children.length;return!!(this.visible&&0<this.alpha&&0!=this.scaleX&&0!=this.scaleY&&t)},t.draw=function(t,e){if(this.DisplayObject_draw(t,e))return!0;for(var i=this.children.slice(),s=0,r=i.length;s<r;s++){var n=i[s];n.isVisible()&&(t.save(),n.updateContext(t),n.draw(t),t.restore())}return!0},t.addChild=function(t){if(null==t)return t;var e=arguments.length;if(1<e){for(var i=0;i<e;i++)this.addChild(arguments[i]);return arguments[e-1]}var s=t.parent,r=s===this;return s&&s._removeChildAt(createjs.indexOf(s.children,t),r),(t.parent=this).children.push(t),r||t.dispatchEvent("added"),t},t.addChildAt=function(t,e){var i=arguments.length,s=arguments[i-1];if(s<0||s>this.children.length)return arguments[i-2];if(2<i){for(var r=0;r<i-1;r++)this.addChildAt(arguments[r],s+r);return arguments[i-2]}var n=t.parent,a=n===this;return n&&n._removeChildAt(createjs.indexOf(n.children,t),a),(t.parent=this).children.splice(e,0,t),a||t.dispatchEvent("added"),t},t.removeChild=function(t){var e=arguments.length;if(1<e){for(var i=!0,s=0;s<e;s++)i=i&&this.removeChild(arguments[s]);return i}return this._removeChildAt(createjs.indexOf(this.children,t))},t.removeChildAt=function(t){var e=arguments.length;if(1<e){for(var i=[],s=0;s<e;s++)i[s]=arguments[s];i.sort(function(t,e){return e-t});for(var r=!0,s=0;s<e;s++)r=r&&this._removeChildAt(i[s]);return r}return this._removeChildAt(t)},t.removeAllChildren=function(){for(var t=this.children;t.length;)this._removeChildAt(0)},t.getChildAt=function(t){return this.children[t]},t.getChildByName=function(t){for(var e=this.children,i=0,s=e.length;i<s;i++)if(e[i].name==t)return e[i];return null},t.sortChildren=function(t){this.children.sort(t)},t.getChildIndex=function(t){return createjs.indexOf(this.children,t)},t.swapChildrenAt=function(t,e){var i=this.children,s=i[t],r=i[e];s&&r&&(i[t]=r,i[e]=s)},t.swapChildren=function(t,e){for(var i,s,r=this.children,n=0,a=r.length;n<a&&(r[n]==t&&(i=n),r[n]==e&&(s=n),null==i||null==s);n++);n!=a&&(r[i]=e,r[s]=t)},t.setChildIndex=function(t,e){var i=this.children,s=i.length;if(!(t.parent!=this||e<0||s<=e)){for(var r=0;r<s&&i[r]!=t;r++);r!=s&&r!=e&&(i.splice(r,1),i.splice(e,0,t))}},t.contains=function(t){for(;t;){if(t==this)return!0;t=t.parent}return!1},t.hitTest=function(t,e){return null!=this.getObjectUnderPoint(t,e)},t.getObjectsUnderPoint=function(t,e,i){var s=[],e=this.localToGlobal(t,e);return this._getObjectsUnderPoint(e.x,e.y,s,0<i,1==i),s},t.getObjectUnderPoint=function(t,e,i){e=this.localToGlobal(t,e);return this._getObjectsUnderPoint(e.x,e.y,null,0<i,1==i)},t.getBounds=function(){return this._getBounds(null,!0)},t.getTransformedBounds=function(){return this._getBounds()},t.clone=function(t){var e=this._cloneProps(new g);return t&&this._cloneChildren(e),e},t.toString=function(){return"[Container (name="+this.name+")]"},t._tick=function(t){if(this.tickChildren)for(var e=this.children.length-1;0<=e;e--){var i=this.children[e];i.tickEnabled&&i._tick&&i._tick(t)}this.DisplayObject__tick(t)},t._cloneChildren=function(t){t.children.length&&t.removeAllChildren();for(var e=t.children,i=0,s=this.children.length;i<s;i++){var r=this.children[i].clone(!0);r.parent=t,e.push(r)}},t._removeChildAt=function(t,e){if(t<0||t>this.children.length-1)return!1;var i=this.children[t];return i&&(i.parent=null),this.children.splice(t,1),e||i.dispatchEvent("removed"),!0},t._getObjectsUnderPoint=function(t,e,i,s,r,n){var a,o,h;if(this.stage&&createjs.stageTransformable&&(a=t,o=e,t=(h=this.stage.getConcatenatedMatrix(this._mtx).transformPoint(t,e)).x,e=h.y),!(n=n||0)&&!this._testMask(this,t,e))return null;var c=createjs.DisplayObject._hitTestContext;r=r||s&&this._hasMouseEventListener();for(var u=this.children,l=u.length-1;0<=l;l--){var d=u[l],_=d.hitArea;if(d.visible&&(_||d.isVisible())&&(!s||d.mouseEnabled)&&(_||this._testMask(d,t,e)))if(!_&&d instanceof g){var p=d._getObjectsUnderPoint(null!=a?a:t,null!=o?o:e,i,s,r,n+1);if(!i&&p)return s&&!this.mouseChildren?this:p}else if(!s||r||d._hasMouseEventListener()){var f=d.getConcatenatedDisplayProps(d._props),p=f.matrix;if(_&&(p.appendMatrix(_.getMatrix(_._props.matrix)),f.alpha=_.alpha),c.globalAlpha=f.alpha,c.setTransform(p.a,p.b,p.c,p.d,p.tx-t,p.ty-e),(_||d).draw(c),this._testHit(c)){if(c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,2,2),!i)return s&&!this.mouseChildren?this:d;i.push(d)}}}return null},t._testMask=function(t,e,i){var s=t.mask;if(!s||!s.graphics||s.graphics.isEmpty())return!0;var r=this._props.matrix,t=t.parent,r=t?t.getConcatenatedMatrix(r):r.identity();r=s.getMatrix(s._props.matrix).prependMatrix(r);t=createjs.DisplayObject._hitTestContext;return t.setTransform(r.a,r.b,r.c,r.d,r.tx-e,r.ty-i),s.graphics.drawAsPath(t),t.fillStyle="#000",t.fill(),!!this._testHit(t)&&(t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,2,2),!0)},t._getBounds=function(t,e){var i=this.DisplayObject_getBounds();if(i)return this._transformBounds(i,t,e);var s=this._props.matrix,s=e?s.identity():this.getMatrix(s);t&&s.prependMatrix(t);for(var r=this.children.length,n=null,a=0;a<r;a++){var o=this.children[a];o.visible&&(i=o._getBounds(s))&&(n?n.extend(i.x,i.y,i.width,i.height):n=i.clone())}return n},createjs.Container=createjs.promote(g,"DisplayObject")}(),function(){"use strict";function t(t,e){this.Container_constructor(),!1===e&&createjs&&createjs.DisplayObject&&(createjs.DisplayObject._hitTestContext=createjs.DisplayObject._hitTestCanvas.getContext("2d",{willReadFrequently:!1}),createjs.willReadFrequently=!1),this.autoClear=!0,this.canvas="string"==typeof t?document.getElementById(t):t,this.mouseX=0,this.mouseY=0,this.drawRect=null,this.snapToPixelEnabled=!1,this.mouseInBounds=!1,this.tickOnUpdate=!0,this.mouseMoveOutside=!1,this.preventSelection=!0,this._pointerData={},this._pointerCount=0,this._primaryPointerID=null,this._mouseOverIntervalID=null,this._nextStage=null,this._prevStage=null,this.enableDOMEvents(!0)}var e=createjs.extend(t,createjs.Container);e._get_nextStage=function(){return this._nextStage},e._set_nextStage=function(t){this._nextStage&&(this._nextStage._prevStage=null),t&&(t._prevStage=this),this._nextStage=t};try{Object.defineProperties(e,{nextStage:{get:e._get_nextStage,set:e._set_nextStage}})}catch(t){}e.update=function(t){if(this.canvas&&(this.tickOnUpdate&&this.tick(t),!1!==this.dispatchEvent("drawstart",!1,!0))){if(createjs.remoteQueue)for(var e,i,s,r=createjs.remoteQueue.length,n=0;n<r;n++)if((s=createjs.remoteQueue[n]).cacheCanvas&&s.updateCache(),s.textureMaps)for(e=s.textureMaps.length,i=0;i<e;i++)s.textureMaps[i].needsUpdate=!0;createjs.DisplayObject._snapToPixelEnabled=this.snapToPixelEnabled;var a=this.drawRect,t=this.canvas.getContext("2d");t.setTransform(1,0,0,1,0,0),this.autoClear&&(a?t.clearRect(a.x,a.y,a.width,a.height):t.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)),t.save(),this.drawRect&&(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.clip()),this.updateContext(t),this.draw(t,!1),t.restore(),this.dispatchEvent("drawend")}},e.tick=function(t){if(this.tickEnabled&&!1!==this.dispatchEvent("tickstart",!1,!0)){var e=new createjs.Event("tick");if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);this._tick(e),this.dispatchEvent("tickend")}},e.handleEvent=function(t){"tick"==t.type&&this.update(t)},e.clear=function(){var t;this.canvas&&((t=this.canvas.getContext("2d")).setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.canvas.width+1,this.canvas.he