Permalink
Please sign in to comment.
Showing
with
13 additions
and 13 deletions.
- +4 −4 dist/stage.cordova.js
- +2 −2 dist/stage.cordova.min.js
- +4 −4 dist/stage.web.js
- +2 −2 dist/stage.web.min.js
- +1 −1 package.json
8
dist/stage.cordova.js
4
dist/stage.cordova.min.js
@@ -1,8 +1,8 @@ | ||
/* | ||
- * Stage.js 0.8.2 | ||
+ * Stage.js 0.8.4 | ||
* | ||
* @copyright 2015 Ali Shakiba, Piqnt LLC | ||
* @license The MIT License | ||
*/ | ||
-!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Stage=t()}}(function(){return function t(e,i,n){function r(o,h){if(!i[o]){if(!e[o]){var a="function"==typeof require&&require;if(!h&&a)return a(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=i[o]={exports:{}};e[o][0].call(f.exports,function(t){var i=e[o][1][t];return r(i?i:t)},f,f.exports,t,e,i,n)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e){e.exports=t("../lib/"),t("../lib/canvas"),t("../lib/image"),t("../lib/anim"),t("../lib/str"),t("../lib/layout"),t("../lib/addon/tween"),e.exports.Mouse=t("../lib/addon/mouse"),e.exports.Math=t("../lib/util/math"),e.exports._extend=t("../lib/util/extend"),e.exports._create=t("../lib/util/create"),t("../lib/loader/cordova")},{"../lib/":11,"../lib/addon/mouse":3,"../lib/addon/tween":4,"../lib/anim":5,"../lib/canvas":7,"../lib/image":10,"../lib/layout":12,"../lib/loader/cordova":13,"../lib/str":18,"../lib/util/create":22,"../lib/util/extend":24,"../lib/util/math":26}],2:[function(t,e){function i(t){return t}function n(t){if("function"==typeof t)return t;if("string"!=typeof t)return i;var e=r[t];if(e)return e;var n=/^(\w+)(-(in|out|in-out|out-in))?(\((.*)\))?$/i.exec(t);return n&&n.length?(easing=o[n[1]],mode=s[n[3]],params=n[5],e=easing&&easing.fn?easing.fn:easing&&easing.fc?easing.fc.apply(easing.fc,params&¶ms.replace(/\s+/,"").split(",")):i,mode&&(e=mode.fn(e)),r[t]=e,e):i}var r={},s={},o={};n.add=function(t){for(var e=(t.name||t.mode).split(/\s+/),i=0;i<e.length;i++){var n=e[i];n&&((t.name?o:s)[n]=t)}},n.add({mode:"in",fn:function(t){return t}}),n.add({mode:"out",fn:function(t){return function(e){return 1-t(1-e)}}}),n.add({mode:"in-out",fn:function(t){return function(e){return.5>e?t(2*e)/2:1-t(2*(1-e))/2}}}),n.add({mode:"out-in",fn:function(t){return function(e){return.5>e?1-t(2*(1-e))/2:t(2*e)/2}}}),n.add({name:"linear",fn:function(t){return t}}),n.add({name:"quad",fn:function(t){return t*t}}),n.add({name:"cubic",fn:function(t){return t*t*t}}),n.add({name:"quart",fn:function(t){return t*t*t*t}}),n.add({name:"quint",fn:function(t){return t*t*t*t*t}}),n.add({name:"sin sine",fn:function(t){return 1-Math.cos(t*Math.PI/2)}}),n.add({name:"exp expo",fn:function(t){return 0==t?0:Math.pow(2,10*(t-1))}}),n.add({name:"circle circ",fn:function(t){return 1-Math.sqrt(1-t*t)}}),n.add({name:"bounce",fn:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}}),n.add({name:"poly",fc:function(t){return function(e){return Math.pow(e,t)}}}),n.add({name:"elastic",fc:function(t,e){e=e||.45,t=t||1;var i=e/(2*Math.PI)*Math.asin(1/t);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin(2*(n-i)*Math.PI/e)}}}),n.add({name:"back",fc:function(t){return t="undefined"!=typeof t?t:1.70158,function(e){return e*e*((t+1)*e-t)}}}),e.exports=n},{}],3:[function(t,e){function i(t,e){if(this instanceof i){var n=t.viewport().ratio||1;t.on("viewport",function(t){n=t.ratio||n}),this.x=0,this.y=0,this.toString=function(){return(0|this.x)+"x"+(0|this.y)},this.locate=function(t){r(e,t,this),this.x*=n,this.y*=n},this.lookup=function(e,i){this.type=e,this.root=t,this.event=null,i.length=0,this.collect=i,this.root.visit(this.visitor,this)},this.publish=function(e,i,n){if(this.type=e,this.root=t,this.event=i,this.collect=!1,this.timeStamp=Date.now(),"mousemove"!==e&&"touchmove"!==e&&DEBUG&&console.log(this.type+" "+this),n){for(;n.length&&!this.visitor.end(n.shift(),this););n.length=0}else this.root.visit(this.visitor,this)},this.visitor={reverse:!0,visible:!0,start:function(t,e){return!t._flag(e.type)},end:function(t,e){s.raw=e.event,s.type=e.type,s.timeStamp=e.timeStamp,s.abs.x=e.x,s.abs.y=e.y;var i=t.listeners(e.type);if(i&&(t.matrix().inverse().map(e,s),(t===e.root||t.hitTest(s))&&(e.collect&&e.collect.push(t),e.event))){for(var n=!1,r=0;r<i.length;r++)n=i[r].call(t,s)?!0:n;return n}}}}}function n(t,e,i){Object.defineProperty(t,e,{value:i})}function r(t,e,i){e.touches&&e.touches.length?(i.x=e.touches[0].clientX,i.y=e.touches[0].clientY):(i.x=e.clientX,i.y=e.clientY);var n=t.getBoundingClientRect();return i.x-=n.left,i.y-=n.top,i.x-=0|t.clientLeft,i.y-=0|t.clientTop,i}"undefined"==typeof DEBUG&&(DEBUG=!0),t("../core")._load(function(t,e){i.subscribe(t,e)}),i.CLICK="click",i.START="touchstart mousedown",i.MOVE="touchmove mousemove",i.END="touchend mouseup",i.CANCEL="touchcancel mousecancel",i.subscribe=function(t,e){function n(e){e.preventDefault(),t.mouse.locate(e),t.mouse.publish(e.type,e),t.mouse.lookup("click",h),t.mouse.lookup("mousecancel",a)}function r(e){e.preventDefault(),t.mouse.locate(e),t.mouse.publish(e.type,e)}function s(e){e.preventDefault(),t.mouse.publish(e.type,e),h.length&&t.mouse.publish("click",e,h),a.length=0}function o(e){a.length&&t.mouse.publish("mousecancel",e,a),h.length=0}if(!t.mouse){t.mouse=new i(t,e),e.addEventListener("touchstart",n),e.addEventListener("touchend",s),e.addEventListener("touchmove",r),e.addEventListener("touchcancel",o),e.addEventListener("mousedown",n),e.addEventListener("mouseup",s),e.addEventListener("mousemove",r),document.addEventListener("mouseup",o),window.addEventListener("blur",o);var h=[],a=[]}};var s={},o={};n(s,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(s,"toString",function(){return(0|this.x)+"x"+(0|this.y)+" ("+this.abs+")"}),n(s,"abs",o),n(o,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(o,"toString",function(){return(0|this.x)+"x"+(0|this.y)}),e.exports=i},{"../core":8}],4:[function(t,e){function i(t,e,i){this._end={},this._duration=e||400,this._delay=i||0,this._owner=t,this._time=0}function n(t,e,i,n){"number"==typeof t.pin(i)?e[i]=n:"number"==typeof t.pin(i+"X")&&"number"==typeof t.pin(i+"Y")&&(e[i+"X"]=n,e[i+"Y"]=n)}var r=t("./easing"),s=t("../core"),o=t("../pin");s.prototype.tween=function(t,e,n){if("number"!=typeof t?(n=t,e=0,t=0):"number"!=typeof e&&(n=e,e=0),!this._tweens){this._tweens=[];var r=0;this.tick(function(t,e,i){if(this._tweens.length){var n=r!=i;if(r=e,n)return!0;var s=this._tweens[0].tick(this,t,e,i);return s&&this._tweens.shift(),"object"==typeof s&&this._tweens.unshift(s),!0}},!0)}this.touch(),n||(this._tweens.length=0);var s=new i(this,t,e);return this._tweens.push(s),s},i.prototype.tick=function(t,e){if(this._time+=e,!(this._time<this._delay)){var i=this._time-this._delay;if(!this._start){this._start={};for(var n in this._end)this._start[n]=this._owner.pin(n)}var r,s;i<this._duration?(r=i/this._duration,s=!1):(r=1,s=!0),r="function"==typeof this._easing?this._easing(r):r;var o=1-r;for(var n in this._end)this._owner.pin(n,this._start[n]*o+this._end[n]*r);if(s){try{this._done&&this._done.call(this._owner)}catch(h){console.log(h)}return this._next||!0}}},i.prototype.tween=function(t,e){return this._next=new i(this._owner,t,e)},i.prototype.duration=function(t){return this._duration=t,this},i.prototype.delay=function(t){return this._delay=t,this},i.prototype.ease=function(t){return this._easing=r(t),this},i.prototype.done=function(t){return this._done=t,this},i.prototype.hide=function(){return this.done(function(){this.hide()}),this},i.prototype.remove=function(){return this.done(function(){this.remove()}),this},i.prototype.pin=function(t,e){if("object"==typeof t)for(var i in t)n(this._owner,this._end,i,t[i]);else"undefined"!=typeof e&&n(this._owner,this._end,t,e);return this},o._add_shortcuts(i),i.prototype.then=function(t){return this.done(t),this},i.prototype.then=function(t){return this.done(t),this},i.prototype.clear=function(){return this},e.exports=i},{"../core":8,"../pin":16,"./easing":2}],5:[function(t){function e(){e._super.call(this),this.label("Anim"),this._textures=[],this._fps=i.Anim.FPS,this._ft=1e3/this._fps,this._time=-1,this._repeat=0,this._index=0,this._frames=[];var t=0;this.tick(function(e,i,n){if(!(this._time<0||this._frames.length<=1)){var r=t!=n;if(t=i,r)return!0;if(this._time+=e,this._time<this._ft)return!0;var s=this._time/this._ft|0;return this._time-=s*this._ft,this.moveFrame(s),this._repeat>0&&(this._repeat-=s)<=0?(this.stop(),this._callback&&this._callback(),!1):!0}},!1)}var i=t("./core");t("./pin"),t("./loop");var n=t("./util/create"),r=t("./util/math");i.anim=function(t,i){var n=new e;return n.frames(t).gotoFrame(0),i&&n.fps(i),n},e._super=i,e.prototype=n(e._super.prototype),i.Anim={FPS:15},e.prototype.fps=function(t){return"undefined"==typeof t?this._fps:(this._fps=t>0?t:i.Anim.FPS,this._ft=1e3/this._fps,this)},e.prototype.setFrames=function(t,e,i){return this.frames(t,e,i)},e.prototype.frames=function(t){return this._index=0,this._frames=i.texture(t).array(),this.touch(),this},e.prototype.length=function(){return this._frames?this._frames.length:0},e.prototype.gotoFrame=function(t,e){return this._index=0|r.rotate(t,this._frames.length),e=e||!this._textures[0],this._textures[0]=this._frames[this._index],e&&(this.pin("width",this._textures[0].width),this.pin("height",this._textures[0].height)),this.touch(),this},e.prototype.moveFrame=function(t){return this.gotoFrame(this._index+t)},e.prototype.repeat=function(t,e){return this._repeat=t*this._frames.length-1,this._callback=e,this.play(),this},e.prototype.play=function(t){return"undefined"!=typeof t?(this.gotoFrame(t),this._time=0):this._time<0&&(this._time=0),this.touch(),this},e.prototype.stop=function(t){return this._time=-1,"undefined"!=typeof t&&this.gotoFrame(t),this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/math":26}],6:[function(t,e){function i(t){function e(t){if(!t||u.fn(t.draw))return t;t=h({},t),u.fn(a)&&(t=a(t)),1!=c&&(t.x*=c,t.y*=c,t.width*=c,t.height*=c,t.top*=c,t.bottom*=c,t.left*=c,t.right*=c),0!=p&&(t.x+=p,t.y+=p,t.width-=2*p,t.height-=2*p,t.top-=p,t.bottom-=p,t.left-=p,t.right-=p);var e=o.pipe();return e.top=t.top,e.bottom=t.bottom,e.left=t.left,e.right=t.right,e.src(t.x,t.y,t.width,t.height),e}function s(t){if(l){if(u.fn(l))return l(t);if(u.hash(l))return l[t]}if(d){for(var e=null,i=0,n=0;n<d.length;n++)f.startsWith(d[n].name,t)&&(0===i?e=d[n]:1===i?e=[e,d[n]]:e.push(d[n]),i++);return 0===i&&u.fn(_)&&(e=function(e){return _(t+(e?e:""))}),e}}i._super.call(this);var o=this;r(t,"filter"),r(t,"cutouts"),r(t,"sprites"),r(t,"factory");var a=t.map||t.filter,c=t.ppu||t.ratio||1,p=t.trim||0,l=t.textures,_=t.factory,d=t.cutouts||t.sprites;this.select=function(t){if(!t)return new n(this.pipe());var i=s(t);return i?new n(i,s,e):void 0}}function n(t,e,i){function n(t,r){return t?u.fn(t.draw)?t:u.hash(t)&&u.number(t.width)&&u.number(t.height)&&u.fn(i)?i(t):u.hash(t)&&u.defined(r)?n(t[r]):u.fn(t)?n(t(r)):u.array(t)?n(t[0]):u.string(t)&&u.fn(e)?n(e(t)):void 0:l}this.one=function(e){return n(t,e)},this.array=function(e){var i=u.array(e)?e:[];if(u.array(t))for(var r=0;r<t.length;r++)i[r]=n(t[r]);else i[0]=n(t);return i}}function r(t,e,i){e in t&&console.log(i?i.replace("%name",e):"'"+e+"' field of texture atlas is deprecated.")}"undefined"==typeof DEBUG&&(DEBUG=!0);var s=t("./core"),o=t("./texture"),h=t("./util/extend"),a=t("./util/create"),u=t("./util/is"),f=t("./util/string"),c={},p=[];s.atlas=function(t){var e=u.fn(t.draw)?t:new i(t);t.name&&(c[t.name]=e),p.push(e),r(t,"imagePath"),r(t,"imageRatio");var n=t.imagePath,o=t.imageRatio||1;return u.string(t.image)?n=t.image:u.hash(t.image)&&(n=t.image.src||t.image.url,o=t.image.ratio||o),n&&s.preload(function(t){n=s.resolve(n),DEBUG&&console.log("Loading atlas: "+n);var i=s.config("image-loader");i(n,function(i){DEBUG&&console.log("Image loaded: "+n),e.src(i,o),t()},function(e){DEBUG&&console.log("Error loading atlas: "+n,e),t()})}),e},i._super=o,i.prototype=a(i._super.prototype);var l=new o;l.x=l.y=l.width=l.height=0,l.pipe=l.src=l.dest=function(){return this},l.draw=function(){};var _=new n(l);s.texture=function(t){if(!u.string(t))return new n(t);var e,i,r=null;for((i=t.indexOf(":"))>0&&t.length>i+1&&(e=c[t.slice(0,i)],r=e&&e.select(t.slice(i+1))),!r&&(e=c[t])&&(r=e.select()),i=0;!r&&i<p.length;i++)r=p[i].select(t);return r||(console.error("Texture not found: "+t),r=_),r},e.exports=i},{"./core":8,"./texture":19,"./util/create":22,"./util/extend":24,"./util/is":25,"./util/string":30}],7:[function(t){var e=t("./core"),i=t("./texture");e.canvas=function(t,e,n){"string"==typeof t?"object"==typeof e||("function"==typeof e&&(n=e),e={}):("function"==typeof t&&(n=t),e={},t="2d");var r=document.createElement("canvas"),s=r.getContext(t,e),o=new i(r);return o.context=function(){return s},o.size=function(t,e,i){return i=i||1,r.width=t*i,r.height=e*i,this.src(r,i),this},o.canvas=function(t){return"function"==typeof t?t.call(this,s):"undefined"==typeof t&&"function"==typeof n&&n.call(this,s),this},"function"==typeof n&&n.call(o,s),o}},{"./core":8,"./texture":19}],8:[function(t,e){function i(t){if(!(this instanceof i))return o.fn(t)?i.app.apply(i,arguments):o.object(t)?i.atlas.apply(i,arguments):t;r.create++;for(var e=0;e<a.length;e++)a[e].call(this)}function n(t,e){var i=document.createElement("script");i.addEventListener("load",function(){e()}),i.addEventListener("error",function(i){e(i||"Error loading script: "+t)}),i.src=t,i.id="preload-"+Date.now(),document.body.appendChild(i)}"undefined"==typeof DEBUG&&(DEBUG=!0);var r=t("./util/stats"),s=t("./util/extend"),o=t("./util/is"),h=t("./util/await");r.create=0;var a=[];i._init=function(t){a.push(t)};var u=[];i._load=function(t){u.push(t)};var f={};i.config=function(){return 1===arguments.length&&o.string(arguments[0])?f[arguments[0]]:(1===arguments.length&&o.object(arguments[0])&&s(f,arguments[0]),void(2===arguments.length&&o.string(arguments[0])&&f[(arguments[0],arguments[1])]))};var c=[],p=[],l=!1,_=!1;i.app=function(t,e){if(!l)return void c.push(arguments);DEBUG&&console.log("Creating app...");var n=i.config("app-loader");n(function(e,i){DEBUG&&console.log("Initing app...");for(var n=0;n<u.length;n++)u[n].call(this,e,i);t(e,i),p.push(e),DEBUG&&console.log("Starting app..."),e.start()},e)};var d=h();i.preload=function(t){if("string"==typeof t){var e=i.resolve(t);/\.js($|\?|\#)/.test(e)&&(DEBUG&&console.log("Loading script: "+e),t=function(t){n(e,t)})}"function"==typeof t&&t(d())},i.start=function(t){DEBUG&&console.log("Starting..."),i.config(t),d.then(function(){for(DEBUG&&console.log("Loading apps..."),l=!0;c.length;){var t=c.shift();i.app.apply(i,t)}})},i.pause=function(){if(!_){_=!0;for(var t=p.length-1;t>=0;t--)p[t].pause()}},i.resume=function(){if(_){_=!1;for(var t=p.length-1;t>=0;t--)p[t].resume()}},i.create=function(){return new i},i.resolve=function(){function t(){if(document.currentScript)return document.currentScript.src;var t;try{var i=new Error;if(!i.stack)throw i;t=i.stack}catch(i){t=i.stack}if("string"==typeof t){t=t.split("\n");for(var n=t.length;n--;){var r=t[n].match(/(\w+\:\/\/[^\/]*?\/.+?)(:\d+)(:\d+)?/);if(r)return r[1]}}if(e.length&&"readyState"in e[0])for(var n=e.length;n--;)if("interactive"===e[n].readyState)return e[n].src;return location.href}if("undefined"==typeof window||"undefined"==typeof document)return function(t){return t};var e=document.getElementsByTagName("script");return function(e){if(/^\.\//.test(e)){var i=t(),n=i.substring(0,i.lastIndexOf("/")+1);e=n+e.substring(2)}return e}}(),e.exports=i},{"./util/await":21,"./util/extend":24,"./util/is":25,"./util/stats":29}],9:[function(t){t("./util/event")(t("./core").prototype,function(t,e,i){t._flag(e,i)})},{"./core":8,"./util/event":23}],10:[function(t){function e(){e._super.call(this),this.label("Image"),this._textures=[],this._image=null}var i=t("./core");t("./pin"),t("./loop");var n=t("./util/repeat"),r=t("./util/create");i.image=function(t){var i=new e;return t&&i.image(t),i},e._super=i,e.prototype=r(e._super.prototype),e.prototype.setImage=function(t,e,i){return this.image(t,e,i)},e.prototype.image=function(t){return this._image=i.texture(t).one(),this.pin("width",this._image?this._image.width:0),this.pin("height",this._image?this._image.height:0),this._textures[0]=this._image.pipe(),this._textures.length=1,this},e.prototype.tile=function(t){return this._repeat(!1,t),this},e.prototype.stretch=function(t){return this._repeat(!0,t),this},e.prototype._repeat=function(t,e){function i(t,e,i,n,s,o,h,a,u){var f=r._textures.length>t?r._textures[t]:r._textures[t]=r._image.pipe();f.src(e,i,n,s),f.dest(o,h,a,u)}var r=this;this.untick(this._repeatTicker),this.tick(this._repeatTicker=function(){if(this._mo_stretch!=this._pin._ts_transform){this._mo_stretch=this._pin._ts_transform;var r=this.pin("width"),s=this.pin("height");this._textures.length=n(this._image,r,s,t,e,i)}})}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/repeat":28}],11:[function(t,e){e.exports=t("./core"),e.exports.Matrix=t("./matrix"),e.exports.Texture=t("./texture"),t("./atlas"),t("./tree"),t("./event"),t("./pin"),t("./loop"),t("./root")},{"./atlas":6,"./core":8,"./event":9,"./loop":14,"./matrix":15,"./pin":16,"./root":17,"./texture":19,"./tree":20}],12:[function(t){var e=t("./core");t("./pin"),t("./loop");t("./util/create");e.row=function(t){return e.create().row(t).label("Row")},e.prototype.row=function(t){return this.sequence("row",t),this},e.column=function(t){return e.create().column(t).label("Row")},e.prototype.column=function(t){return this.sequence("column",t),this},e.sequence=function(t,i){return e.create().sequence(t,i).label("Sequence")},e.prototype.sequence=function(t,e){return this._padding=this._padding||0,this._spacing=this._spacing||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_seq!=this._ts_touch){this._mo_seq=this._ts_touch;var i=this._mo_seqAlign!=this._ts_children;this._mo_seqAlign=this._ts_children;for(var n,r=0,s=0,o=this.first(!0),h=!0;n=o;){o=n.next(!0),n.matrix(!0);var a=n.pin("boxWidth"),u=n.pin("boxHeight");"column"==t?(!h&&(s+=this._spacing),n.pin("offsetY")!=s&&n.pin("offsetY",s),r=Math.max(r,a),s+=u,i&&n.pin("alignX",e)):"row"==t&&(!h&&(r+=this._spacing),n.pin("offsetX")!=r&&n.pin("offsetX",r),r+=a,s=Math.max(s,u),i&&n.pin("alignY",e)),h=!1}r+=2*this._padding,s+=2*this._padding,this.pin("width")!=r&&this.pin("width",r),this.pin("height")!=s&&this.pin("height",s)}}),this},e.box=function(){return e.create().box().label("Box")},e.prototype.box=function(){return this._padding=this._padding||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_box!=this._ts_touch){this._mo_box=this._ts_touch;for(var t,e=0,i=0,n=this.first(!0);t=n;){n=t.next(!0),t.matrix(!0);var r=t.pin("boxWidth"),s=t.pin("boxHeight");e=Math.max(e,r),i=Math.max(i,s)}e+=2*this._padding,i+=2*this._padding,this.pin("width")!=e&&this.pin("width",e),this.pin("height")!=i&&this.pin("height",i)}}),this},e.layer=function(){return e.create().layer().label("Layer")},e.prototype.layer=function(){return this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){var t=this.parent();if(t){var e=t.pin("width");this.pin("width")!=e&&this.pin("width",e);var i=t.pin("height");this.pin("height")!=i&&this.pin("height",i)}},!0),this},e.prototype.padding=function(t){return this._padding=t,this},e.prototype.spacing=function(t){return this._spacing=t,this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22}],13:[function(t){function e(t,e){function i(){o.isFast?(o.clear(),o.setTransform(1,0,0,1,0,0)):(o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,a,u)),d.render(o)}function r(){h?(a=window.innerWidth>0?window.innerWidth:screen.width,u=window.innerHeight>0?window.innerHeight:screen.height,s.style.width=a+"px",s.style.height=u+"px"):(a=s.clientWidth,u=s.clientHeight),a*=f,u*=f,(s.width!==a||s.height!==u)&&(s.width=a,s.height=u,DEBUG&&console.log("Resize: "+a+" x "+u+" / "+f),d.viewport(a,u,f),i())}e=e||{};var s=e.canvas,o=null,h=!1,a=0,u=0,f=1;if("string"==typeof s&&(s=document.getElementById(s)),s||(s=document.getElementById("cutjs")||document.getElementById("stage")),!s){h=!0,DEBUG&&console.log("Creating Canvas..."),s=document.createElement("canvas"),s.style.position="absolute";var c=document.body;c.insertBefore(s,c.firstChild)}o=s.getContext("2d",{fastcontext:!0}),o.isFast=!!o.isFast,h=h||o.isFast,DEBUG&&console.log("FastContext: "+o.isFast);var p=window.devicePixelRatio||1,l=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;f=p/l;var _=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)};DEBUG&&console.log("Creating stage...");var d=n.root(_,i);d.background=function(t){return o.isFast?o.setBackgroundColor&&o.setBackgroundColor(t):s.style.backgroundColor=t,this},t(d,s),r(),window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1)}function i(t,e,i){function n(){e(r)}DEBUG&&console.log("Loading image: "+t);var r;FastContext?r=FastContext.createImage(t,n,i):(r=new Image,r.onload=n,r.onerror=i,r.src=t)}"undefined"==typeof DEBUG&&(DEBUG=!0);var n=t("../core"),r=t("../util/once");"undefined"==typeof FastContext&&(FastContext=window.FastContext),window.addEventListener("load",function(){DEBUG&&console.log("On load.");var t=r(function(t){DEBUG&&t&&console.log("Started on "+t),n.start()});document.addEventListener("click",function(){t("click")},!1),document.addEventListener("mousemove",function(){t("mousemove")},!1),document.addEventListener("deviceready",function(){t("deviceready")},!1),document.addEventListener("pause",function(){n.pause()},!1),document.addEventListener("resume",function(){n.resume()},!1)},!1),n.config({"app-loader":e,"image-loader":i})},{"../core":8,"../util/once":27}],14:[function(t){var e=t("./core");t("./pin");var i=t("./util/stats");e.prototype._textures=null,e.prototype._alpha=1,e.prototype.render=function(t){if(this._visible){i.node++;var e=this.matrix();t.setTransform(e.a,e.b,e.c,e.d,e.e,e.f),this._alpha=this._pin._alpha*(this._parent?this._parent._alpha:1);var n=this._pin._textureAlpha*this._alpha;if(t.globalAlpha!=n&&(t.globalAlpha=n),null!==this._textures)for(var r=0,s=this._textures.length;s>r;r++)this._textures[r].draw(t);t.globalAlpha!=this._alpha&&(t.globalAlpha=this._alpha);for(var o,h=this._first;o=h;)h=o._next,o.render(t)}},e.prototype._tickBefore=null,e.prototype._tickAfter=null,e.prototype.MAX_ELAPSE=1/0,e.prototype._tick=function(t,e,n){if(this._visible){t>this.MAX_ELAPSE&&(t=this.MAX_ELAPSE);var r=!1;if(null!==this._tickBefore)for(var s=0,o=this._tickBefore.length;o>s;s++)i.tick++,r=this._tickBefore[s].call(this,t,e,n)===!0||r;for(var h,a=this._first;h=a;)a=h._next,h._flag("_tick")&&(r=h._tick(t,e,n)===!0?!0:r);if(null!==this._tickAfter)for(var s=0,o=this._tickAfter.length;o>s;s++)i.tick++,r=this._tickAfter[s].call(this,t,e,n)===!0||r;return r}},e.prototype.tick=function(t,e){"function"==typeof t&&(e?(null===this._tickBefore&&(this._tickBefore=[]),this._tickBefore.push(t)):(null===this._tickAfter&&(this._tickAfter=[]),this._tickAfter.push(t)),this._flag("_tick",null!==this._tickAfter&&this._tickAfter.length>0||null!==this._tickBefore&&this._tickBefore.length>0))},e.prototype.untick=function(t){if("function"==typeof t){var e;null!==this._tickBefore&&(e=this._tickBefore.indexOf(t))>=0&&this._tickBefore.splice(e,1),null!==this._tickAfter&&(e=this._tickAfter.indexOf(t))>=0&&this._tickAfter.splice(e,1)}},e.prototype.timeout=function(t,e){this.tick(function i(n){return(e-=n)<0?(this.untick(i),void t.call(this)):!0})}},{"./core":8,"./pin":16,"./util/stats":29}],15:[function(t,e){function i(t,e,i,n,r,s){this.reset(t,e,i,n,r,s)}i.prototype.toString=function(){return"["+this.a+", "+this.b+", "+this.c+", "+this.d+", "+this.e+", "+this.f+"]"},i.prototype.clone=function(){return new i(this.a,this.b,this.c,this.d,this.e,this.f)},i.prototype.reset=function(t,e,i,n,r,s){return this._dirty=!0,"object"==typeof t?(this.a=t.a,this.d=t.d,this.b=t.b,this.c=t.c,this.e=t.e,this.f=t.f):(this.a=t||1,this.d=n||1,this.b=e||0,this.c=i||0,this.e=r||0,this.f=s||0),this},i.prototype.identity=function(){return this._dirty=!0,this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this},i.prototype.rotate=function(t){if(!t)return this;this._dirty=!0;var e=t?Math.cos(t):1,i=t?Math.sin(t):0,n=e*this.a-i*this.b,r=e*this.b+i*this.a,s=e*this.c-i*this.d,o=e*this.d+i*this.c,h=e*this.e-i*this.f,a=e*this.f+i*this.e;return this.a=n,this.b=r,this.c=s,this.d=o,this.e=h,this.f=a,this},i.prototype.translate=function(t,e){return t||e?(this._dirty=!0,this.e+=t,this.f+=e,this):this},i.prototype.scale=function(t,e){return t-1||e-1?(this._dirty=!0,this.a*=t,this.b*=e,this.c*=t,this.d*=e,this.e*=t,this.f*=e,this):this},i.prototype.skew=function(t,e){if(!t&&!e)return this;this._dirty=!0;var i=this.a+this.b*t,n=this.b+this.a*e,r=this.c+this.d*t,s=this.d+this.c*e,o=this.e+this.f*t,h=this.f+this.e*e;return this.a=i,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},i.prototype.concat=function(t){this._dirty=!0;var e=this,i=e.a*t.a+e.b*t.c,n=e.b*t.d+e.a*t.b,r=e.c*t.a+e.d*t.c,s=e.d*t.d+e.c*t.b,o=e.e*t.a+t.e+e.f*t.c,h=e.f*t.d+t.f+e.e*t.b;return this.a=i,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},i.prototype.inverse=i.prototype.reverse=function(){if(this._dirty){this._dirty=!1,this.inversed=this.inversed||new i;var t=this.a*this.d-this.b*this.c;this.inversed.a=this.d/t,this.inversed.b=-this.b/t,this.inversed.c=-this.c/t,this.inversed.d=this.a/t,this.inversed.e=(this.c*this.f-this.e*this.d)/t,this.inversed.f=(this.e*this.b-this.a*this.f)/t}return this.inversed},i.prototype.map=function(t,e){return e=e||{},e.x=this.a*t.x+this.c*t.y+this.e,e.y=this.b*t.x+this.d*t.y+this.f,e},i.prototype.mapX=function(t,e){return"object"==typeof t&&(e=t.y,t=t.x),this.a*t+this.c*e+this.e},i.prototype.mapY=function(t,e){return"object"==typeof t&&(e=t.y,t=t.x),this.b*t+this.d*e+this.f},e.exports=i},{}],16:[function(t,e){function i(t){this._owner=t,this._parent=null,this._relativeMatrix=new s,this._absoluteMatrix=new s,this.reset()}function n(t,e,i,n){var r="number"==typeof e,s="number"==typeof i,h="string"==typeof n;t._ts_transform=++o,r&&(t._scaleX=e/t._width_,t._width=t._width_),s&&(t._scaleY=i/t._height_,t._height=t._height_),r&&s&&h&&("out"==n||"out-crop"==n?t._scaleX=t._scaleY=Math.max(t._scaleX,t._scaleY):("in"==n||"in-pad"==n)&&(t._scaleX=t._scaleY=Math.min(t._scaleX,t._scaleY)),("out-crop"==n||"in-pad"==n)&&(t._width=e/t._scaleX,t._height=i/t._scaleY))}var r=t("./core"),s=t("./matrix"),o=0;r._init(function(){this._pin=new i(this)}),r.prototype.matrix=function(t){return t===!0?this._pin.relativeMatrix():this._pin.absoluteMatrix()},r.prototype.pin=function(t,e){return"object"==typeof t?(this._pin.set(t),this):"string"==typeof t?"undefined"==typeof e?this._pin.get(t):(this._pin.set(t,e),this):"undefined"==typeof t?this._pin:void 0},i.prototype.reset=function(){this._textureAlpha=1,this._alpha=1,this._width=0,this._height=0,this._scaleX=1,this._scaleY=1,this._skewX=0,this._skewY=0,this._rotation=0,this._pivoted=!1,this._pivotX=null,this._pivotY=null,this._handled=!1,this._handleX=0,this._handleY=0,this._aligned=!1,this._alignX=0,this._alignY=0,this._offsetX=0,this._offsetY=0,this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height,this._ts_translate=++o,this._ts_transform=++o,this._ts_matrix=++o},i.prototype._update=function(){return this._parent=this._owner._parent&&this._owner._parent._pin,this._handled&&this._mo_handle!=this._ts_transform&&(this._mo_handle=this._ts_transform,this._ts_translate=++o),this._aligned&&this._parent&&this._mo_align!=this._parent._ts_transform&&(this._mo_align=this._parent._ts_transform,this._ts_translate=++o),this},i.prototype.toString=function(){return this._owner+" ("+(this._parent?this._parent._owner:null)+")"},i.prototype.absoluteMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_matrix:0);if(this._mo_abs==t)return this._absoluteMatrix;this._mo_abs=t;var e=this._absoluteMatrix;return e.reset(this.relativeMatrix()),this._parent&&e.concat(this._parent._absoluteMatrix),this._ts_matrix=++o,e},i.prototype.relativeMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_transform:0);if(this._mo_rel==t)return this._relativeMatrix;this._mo_rel=t;var e=this._relativeMatrix;if(e.identity(),this._pivoted&&e.translate(-this._pivotX*this._width,-this._pivotY*this._height),e.scale(this._scaleX,this._scaleY),e.skew(this._skewX,this._skewY),e.rotate(this._rotation),this._pivoted&&e.translate(this._pivotX*this._width,this._pivotY*this._height),this._pivoted)this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height;else{var i,n;e.a>0&&e.c>0||e.a<0&&e.c<0?(i=0,n=e.a*this._width+e.c*this._height):(i=e.a*this._width,n=e.c*this._height),i>n?(this._boxX=n,this._boxWidth=i-n):(this._boxX=i,this._boxWidth=n-i),e.b>0&&e.d>0||e.b<0&&e.d<0?(i=0,n=e.b*this._width+e.d*this._height):(i=e.b*this._width,n=e.d*this._height),i>n?(this._boxY=n,this._boxHeight=i-n):(this._boxY=i,this._boxHeight=n-i)}return this._x=this._offsetX,this._y=this._offsetY,this._x-=this._boxX+this._handleX*this._boxWidth,this._y-=this._boxY+this._handleY*this._boxHeight,this._aligned&&this._parent&&(this._parent.relativeMatrix(),this._x+=this._alignX*this._parent._width,this._y+=this._alignY*this._parent._height),e.translate(this._x,this._y),this._relativeMatrix},i.prototype.get=function(t){return"function"==typeof h[t]?h[t](this):void 0},i.prototype.set=function(t,e){if("string"==typeof t)"function"==typeof a[t]&&"undefined"!=typeof e&&a[t](this,e);else if("object"==typeof t)for(e in t)"function"==typeof a[e]&&"undefined"!=typeof t[e]&&a[e](this,t[e],t);return this._owner&&(this._owner._ts_pin=++o,this._owner.touch()),this};var h={alpha:function(t){return t._alpha},textureAlpha:function(t){return t._textureAlpha},width:function(t){return t._width},height:function(t){return t._height},boxWidth:function(t){return t._boxWidth},boxHeight:function(t){return t._boxHeight},scaleX:function(t){return t._scaleX},scaleY:function(t){return t._scaleY},skewX:function(t){return t._skewX},skewY:function(t){return t._skewY},rotation:function(t){return t._rotation},pivotX:function(t){return t._pivotX},pivotY:function(t){return t._pivotY},offsetX:function(t){return t._offsetX},offsetY:function(t){return t._offsetY},alignX:function(t){return t._alignX},alignY:function(t){return t._alignY},handleX:function(t){return t._handleX},handleY:function(t){return t._handleY}},a={alpha:function(t,e){t._alpha=e},textureAlpha:function(t,e){t._textureAlpha=e},width:function(t,e){t._width_=e,t._width=e,t._ts_transform=++o},height:function(t,e){t._height_=e,t._height=e,t._ts_transform=++o},scale:function(t,e){t._scaleX=e,t._scaleY=e,t._ts_transform=++o},scaleX:function(t,e){t._scaleX=e,t._ts_transform=++o},scaleY:function(t,e){t._scaleY=e,t._ts_transform=++o},skew:function(t,e){t._skewX=e,t._skewY=e,t._ts_transform=++o},skewX:function(t,e){t._skewX=e,t._ts_transform=++o},skewY:function(t,e){t._skewY=e,t._ts_transform=++o},rotation:function(t,e){t._rotation=e,t._ts_transform=++o},pivot:function(t,e){t._pivotX=e,t._pivotY=e,t._pivoted=!0,t._ts_transform=++o},pivotX:function(t,e){t._pivotX=e,t._pivoted=!0,t._ts_transform=++o},pivotY:function(t,e){t._pivotY=e,t._pivoted=!0,t._ts_transform=++o},offset:function(t,e){t._offsetX=e,t._offsetY=e,t._ts_translate=++o},offsetX:function(t,e){t._offsetX=e,t._ts_translate=++o},offsetY:function(t,e){t._offsetY=e,t._ts_translate=++o},align:function(t,e){this.alignX(t,e),this.alignY(t,e)},alignX:function(t,e){t._alignX=e,t._aligned=!0,t._ts_translate=++o,this.handleX(t,e)},alignY:function(t,e){t._alignY=e,t._aligned=!0,t._ts_translate=++o,this.handleY(t,e) | ||
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Stage=t()}}(function(){return function t(e,i,n){function r(o,h){if(!i[o]){if(!e[o]){var a="function"==typeof require&&require;if(!h&&a)return a(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=i[o]={exports:{}};e[o][0].call(f.exports,function(t){var i=e[o][1][t];return r(i?i:t)},f,f.exports,t,e,i,n)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e){e.exports=t("../lib/"),t("../lib/canvas"),t("../lib/image"),t("../lib/anim"),t("../lib/str"),t("../lib/layout"),t("../lib/addon/tween"),e.exports.Mouse=t("../lib/addon/mouse"),e.exports.Math=t("../lib/util/math"),e.exports._extend=t("../lib/util/extend"),e.exports._create=t("../lib/util/create"),t("../lib/loader/cordova")},{"../lib/":11,"../lib/addon/mouse":3,"../lib/addon/tween":4,"../lib/anim":5,"../lib/canvas":7,"../lib/image":10,"../lib/layout":12,"../lib/loader/cordova":13,"../lib/str":18,"../lib/util/create":22,"../lib/util/extend":24,"../lib/util/math":26}],2:[function(t,e){function i(t){return t}function n(t){if("function"==typeof t)return t;if("string"!=typeof t)return i;var e=r[t];if(e)return e;var n=/^(\w+)(-(in|out|in-out|out-in))?(\((.*)\))?$/i.exec(t);if(!n||!n.length)return i;var h=o[n[1]],a=s[n[3]],u=n[5];return e=h&&h.fn?h.fn:h&&h.fc?h.fc.apply(h.fc,u&&u.replace(/\s+/,"").split(",")):i,a&&(e=a.fn(e)),r[t]=e,e}var r={},s={},o={};n.add=function(t){for(var e=(t.name||t.mode).split(/\s+/),i=0;i<e.length;i++){var n=e[i];n&&((t.name?o:s)[n]=t)}},n.add({mode:"in",fn:function(t){return t}}),n.add({mode:"out",fn:function(t){return function(e){return 1-t(1-e)}}}),n.add({mode:"in-out",fn:function(t){return function(e){return.5>e?t(2*e)/2:1-t(2*(1-e))/2}}}),n.add({mode:"out-in",fn:function(t){return function(e){return.5>e?1-t(2*(1-e))/2:t(2*e)/2}}}),n.add({name:"linear",fn:function(t){return t}}),n.add({name:"quad",fn:function(t){return t*t}}),n.add({name:"cubic",fn:function(t){return t*t*t}}),n.add({name:"quart",fn:function(t){return t*t*t*t}}),n.add({name:"quint",fn:function(t){return t*t*t*t*t}}),n.add({name:"sin sine",fn:function(t){return 1-Math.cos(t*Math.PI/2)}}),n.add({name:"exp expo",fn:function(t){return 0==t?0:Math.pow(2,10*(t-1))}}),n.add({name:"circle circ",fn:function(t){return 1-Math.sqrt(1-t*t)}}),n.add({name:"bounce",fn:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}}),n.add({name:"poly",fc:function(t){return function(e){return Math.pow(e,t)}}}),n.add({name:"elastic",fc:function(t,e){e=e||.45,t=t||1;var i=e/(2*Math.PI)*Math.asin(1/t);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin(2*(n-i)*Math.PI/e)}}}),n.add({name:"back",fc:function(t){return t="undefined"!=typeof t?t:1.70158,function(e){return e*e*((t+1)*e-t)}}}),e.exports=n},{}],3:[function(t,e){function i(t,e){if(this instanceof i){var n=t.viewport().ratio||1;t.on("viewport",function(t){n=t.ratio||n}),this.x=0,this.y=0,this.toString=function(){return(0|this.x)+"x"+(0|this.y)},this.locate=function(t){r(e,t,this),this.x*=n,this.y*=n},this.lookup=function(e,i){this.type=e,this.root=t,this.event=null,i.length=0,this.collect=i,this.root.visit(this.visitor,this)},this.publish=function(e,i,n){if(this.type=e,this.root=t,this.event=i,this.collect=!1,this.timeStamp=Date.now(),"mousemove"!==e&&"touchmove"!==e&&DEBUG&&console.log(this.type+" "+this),n){for(;n.length&&!this.visitor.end(n.shift(),this););n.length=0}else this.root.visit(this.visitor,this)},this.visitor={reverse:!0,visible:!0,start:function(t,e){return!t._flag(e.type)},end:function(t,e){s.raw=e.event,s.type=e.type,s.timeStamp=e.timeStamp,s.abs.x=e.x,s.abs.y=e.y;var i=t.listeners(e.type);if(i&&(t.matrix().inverse().map(e,s),(t===e.root||t.hitTest(s))&&(e.collect&&e.collect.push(t),e.event))){for(var n=!1,r=0;r<i.length;r++)n=i[r].call(t,s)?!0:n;return n}}}}}function n(t,e,i){Object.defineProperty(t,e,{value:i})}function r(t,e,i){e.touches&&e.touches.length?(i.x=e.touches[0].clientX,i.y=e.touches[0].clientY):(i.x=e.clientX,i.y=e.clientY);var n=t.getBoundingClientRect();return i.x-=n.left,i.y-=n.top,i.x-=0|t.clientLeft,i.y-=0|t.clientTop,i}"undefined"==typeof DEBUG&&(DEBUG=!0),t("../core")._load(function(t,e){i.subscribe(t,e)}),i.CLICK="click",i.START="touchstart mousedown",i.MOVE="touchmove mousemove",i.END="touchend mouseup",i.CANCEL="touchcancel mousecancel",i.subscribe=function(t,e){function n(e){e.preventDefault(),t.mouse.locate(e),t.mouse.publish(e.type,e),t.mouse.lookup("click",h),t.mouse.lookup("mousecancel",a)}function r(e){e.preventDefault(),t.mouse.locate(e),t.mouse.publish(e.type,e)}function s(e){e.preventDefault(),t.mouse.publish(e.type,e),h.length&&t.mouse.publish("click",e,h),a.length=0}function o(e){a.length&&t.mouse.publish("mousecancel",e,a),h.length=0}if(!t.mouse){t.mouse=new i(t,e),e.addEventListener("touchstart",n),e.addEventListener("touchend",s),e.addEventListener("touchmove",r),e.addEventListener("touchcancel",o),e.addEventListener("mousedown",n),e.addEventListener("mouseup",s),e.addEventListener("mousemove",r),document.addEventListener("mouseup",o),window.addEventListener("blur",o);var h=[],a=[]}};var s={},o={};n(s,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(s,"toString",function(){return(0|this.x)+"x"+(0|this.y)+" ("+this.abs+")"}),n(s,"abs",o),n(o,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(o,"toString",function(){return(0|this.x)+"x"+(0|this.y)}),e.exports=i},{"../core":8}],4:[function(t,e){function i(t,e,i){this._end={},this._duration=e||400,this._delay=i||0,this._owner=t,this._time=0}function n(t,e,i,n){"number"==typeof t.pin(i)?e[i]=n:"number"==typeof t.pin(i+"X")&&"number"==typeof t.pin(i+"Y")&&(e[i+"X"]=n,e[i+"Y"]=n)}var r=t("./easing"),s=t("../core"),o=t("../pin");s.prototype.tween=function(t,e,n){if("number"!=typeof t?(n=t,e=0,t=0):"number"!=typeof e&&(n=e,e=0),!this._tweens){this._tweens=[];var r=0;this.tick(function(t,e,i){if(this._tweens.length){var n=r!=i;if(r=e,n)return!0;var s=this._tweens[0].tick(this,t,e,i);return s&&this._tweens.shift(),"object"==typeof s&&this._tweens.unshift(s),!0}},!0)}this.touch(),n||(this._tweens.length=0);var s=new i(this,t,e);return this._tweens.push(s),s},i.prototype.tick=function(t,e){if(this._time+=e,!(this._time<this._delay)){var i=this._time-this._delay;if(!this._start){this._start={};for(var n in this._end)this._start[n]=this._owner.pin(n)}var r,s;i<this._duration?(r=i/this._duration,s=!1):(r=1,s=!0),r="function"==typeof this._easing?this._easing(r):r;var o=1-r;for(var n in this._end)this._owner.pin(n,this._start[n]*o+this._end[n]*r);if(s){try{this._done&&this._done.call(this._owner)}catch(h){console.log(h)}return this._next||!0}}},i.prototype.tween=function(t,e){return this._next=new i(this._owner,t,e)},i.prototype.duration=function(t){return this._duration=t,this},i.prototype.delay=function(t){return this._delay=t,this},i.prototype.ease=function(t){return this._easing=r(t),this},i.prototype.done=function(t){return this._done=t,this},i.prototype.hide=function(){return this.done(function(){this.hide()}),this},i.prototype.remove=function(){return this.done(function(){this.remove()}),this},i.prototype.pin=function(t,e){if("object"==typeof t)for(var i in t)n(this._owner,this._end,i,t[i]);else"undefined"!=typeof e&&n(this._owner,this._end,t,e);return this},o._add_shortcuts(i),i.prototype.then=function(t){return this.done(t),this},i.prototype.then=function(t){return this.done(t),this},i.prototype.clear=function(){return this},e.exports=i},{"../core":8,"../pin":16,"./easing":2}],5:[function(t){function e(){e._super.call(this),this.label("Anim"),this._textures=[],this._fps=i.Anim.FPS,this._ft=1e3/this._fps,this._time=-1,this._repeat=0,this._index=0,this._frames=[];var t=0;this.tick(function(e,i,n){if(!(this._time<0||this._frames.length<=1)){var r=t!=n;if(t=i,r)return!0;if(this._time+=e,this._time<this._ft)return!0;var s=this._time/this._ft|0;return this._time-=s*this._ft,this.moveFrame(s),this._repeat>0&&(this._repeat-=s)<=0?(this.stop(),this._callback&&this._callback(),!1):!0}},!1)}var i=t("./core");t("./pin"),t("./loop");var n=t("./util/create"),r=t("./util/math");i.anim=function(t,i){var n=new e;return n.frames(t).gotoFrame(0),i&&n.fps(i),n},e._super=i,e.prototype=n(e._super.prototype),i.Anim={FPS:15},e.prototype.fps=function(t){return"undefined"==typeof t?this._fps:(this._fps=t>0?t:i.Anim.FPS,this._ft=1e3/this._fps,this)},e.prototype.setFrames=function(t,e,i){return this.frames(t,e,i)},e.prototype.frames=function(t){return this._index=0,this._frames=i.texture(t).array(),this.touch(),this},e.prototype.length=function(){return this._frames?this._frames.length:0},e.prototype.gotoFrame=function(t,e){return this._index=0|r.rotate(t,this._frames.length),e=e||!this._textures[0],this._textures[0]=this._frames[this._index],e&&(this.pin("width",this._textures[0].width),this.pin("height",this._textures[0].height)),this.touch(),this},e.prototype.moveFrame=function(t){return this.gotoFrame(this._index+t)},e.prototype.repeat=function(t,e){return this._repeat=t*this._frames.length-1,this._callback=e,this.play(),this},e.prototype.play=function(t){return"undefined"!=typeof t?(this.gotoFrame(t),this._time=0):this._time<0&&(this._time=0),this.touch(),this},e.prototype.stop=function(t){return this._time=-1,"undefined"!=typeof t&&this.gotoFrame(t),this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/math":26}],6:[function(t,e){function i(t){function e(t){if(!t||u.fn(t.draw))return t;t=h({},t),u.fn(a)&&(t=a(t)),1!=c&&(t.x*=c,t.y*=c,t.width*=c,t.height*=c,t.top*=c,t.bottom*=c,t.left*=c,t.right*=c),0!=p&&(t.x+=p,t.y+=p,t.width-=2*p,t.height-=2*p,t.top-=p,t.bottom-=p,t.left-=p,t.right-=p);var e=o.pipe();return e.top=t.top,e.bottom=t.bottom,e.left=t.left,e.right=t.right,e.src(t.x,t.y,t.width,t.height),e}function s(t){if(l){if(u.fn(l))return l(t);if(u.hash(l))return l[t]}if(d){for(var e=null,i=0,n=0;n<d.length;n++)f.startsWith(d[n].name,t)&&(0===i?e=d[n]:1===i?e=[e,d[n]]:e.push(d[n]),i++);return 0===i&&u.fn(_)&&(e=function(e){return _(t+(e?e:""))}),e}}i._super.call(this);var o=this;r(t,"filter"),r(t,"cutouts"),r(t,"sprites"),r(t,"factory");var a=t.map||t.filter,c=t.ppu||t.ratio||1,p=t.trim||0,l=t.textures,_=t.factory,d=t.cutouts||t.sprites;this.select=function(t){if(!t)return new n(this.pipe());var i=s(t);return i?new n(i,s,e):void 0}}function n(t,e,i){function n(t,r){return t?u.fn(t.draw)?t:u.hash(t)&&u.number(t.width)&&u.number(t.height)&&u.fn(i)?i(t):u.hash(t)&&u.defined(r)?n(t[r]):u.fn(t)?n(t(r)):u.array(t)?n(t[0]):u.string(t)&&u.fn(e)?n(e(t)):void 0:l}this.one=function(e){return n(t,e)},this.array=function(e){var i=u.array(e)?e:[];if(u.array(t))for(var r=0;r<t.length;r++)i[r]=n(t[r]);else i[0]=n(t);return i}}function r(t,e,i){e in t&&console.log(i?i.replace("%name",e):"'"+e+"' field of texture atlas is deprecated.")}"undefined"==typeof DEBUG&&(DEBUG=!0);var s=t("./core"),o=t("./texture"),h=t("./util/extend"),a=t("./util/create"),u=t("./util/is"),f=t("./util/string"),c={},p=[];s.atlas=function(t){var e=u.fn(t.draw)?t:new i(t);t.name&&(c[t.name]=e),p.push(e),r(t,"imagePath"),r(t,"imageRatio");var n=t.imagePath,o=t.imageRatio||1;return u.string(t.image)?n=t.image:u.hash(t.image)&&(n=t.image.src||t.image.url,o=t.image.ratio||o),n&&s.preload(function(t){n=s.resolve(n),DEBUG&&console.log("Loading atlas: "+n);var i=s.config("image-loader");i(n,function(i){DEBUG&&console.log("Image loaded: "+n),e.src(i,o),t()},function(e){DEBUG&&console.log("Error loading atlas: "+n,e),t()})}),e},i._super=o,i.prototype=a(i._super.prototype);var l=new o;l.x=l.y=l.width=l.height=0,l.pipe=l.src=l.dest=function(){return this},l.draw=function(){};var _=new n(l);s.texture=function(t){if(!u.string(t))return new n(t);var e,i,r=null;for((i=t.indexOf(":"))>0&&t.length>i+1&&(e=c[t.slice(0,i)],r=e&&e.select(t.slice(i+1))),!r&&(e=c[t])&&(r=e.select()),i=0;!r&&i<p.length;i++)r=p[i].select(t);return r||(console.error("Texture not found: "+t),r=_),r},e.exports=i},{"./core":8,"./texture":19,"./util/create":22,"./util/extend":24,"./util/is":25,"./util/string":30}],7:[function(t){var e=t("./core"),i=t("./texture");e.canvas=function(t,e,n){"string"==typeof t?"object"==typeof e||("function"==typeof e&&(n=e),e={}):("function"==typeof t&&(n=t),e={},t="2d");var r=document.createElement("canvas"),s=r.getContext(t,e),o=new i(r);return o.context=function(){return s},o.size=function(t,e,i){return i=i||1,r.width=t*i,r.height=e*i,this.src(r,i),this},o.canvas=function(t){return"function"==typeof t?t.call(this,s):"undefined"==typeof t&&"function"==typeof n&&n.call(this,s),this},"function"==typeof n&&n.call(o,s),o}},{"./core":8,"./texture":19}],8:[function(t,e){function i(t){if(!(this instanceof i))return o.fn(t)?i.app.apply(i,arguments):o.object(t)?i.atlas.apply(i,arguments):t;r.create++;for(var e=0;e<a.length;e++)a[e].call(this)}function n(t,e){var i=document.createElement("script");i.addEventListener("load",function(){e()}),i.addEventListener("error",function(i){e(i||"Error loading script: "+t)}),i.src=t,i.id="preload-"+Date.now(),document.body.appendChild(i)}"undefined"==typeof DEBUG&&(DEBUG=!0);var r=t("./util/stats"),s=t("./util/extend"),o=t("./util/is"),h=t("./util/await");r.create=0;var a=[];i._init=function(t){a.push(t)};var u=[];i._load=function(t){u.push(t)};var f={};i.config=function(){return 1===arguments.length&&o.string(arguments[0])?f[arguments[0]]:(1===arguments.length&&o.object(arguments[0])&&s(f,arguments[0]),void(2===arguments.length&&o.string(arguments[0])&&f[(arguments[0],arguments[1])]))};var c=[],p=[],l=!1,_=!1;i.app=function(t,e){if(!l)return void c.push(arguments);DEBUG&&console.log("Creating app...");var n=i.config("app-loader");n(function(e,i){DEBUG&&console.log("Initing app...");for(var n=0;n<u.length;n++)u[n].call(this,e,i);t(e,i),p.push(e),DEBUG&&console.log("Starting app..."),e.start()},e)};var d=h();i.preload=function(t){if("string"==typeof t){var e=i.resolve(t);/\.js($|\?|\#)/.test(e)&&(DEBUG&&console.log("Loading script: "+e),t=function(t){n(e,t)})}"function"==typeof t&&t(d())},i.start=function(t){DEBUG&&console.log("Starting..."),i.config(t),d.then(function(){for(DEBUG&&console.log("Loading apps..."),l=!0;c.length;){var t=c.shift();i.app.apply(i,t)}})},i.pause=function(){if(!_){_=!0;for(var t=p.length-1;t>=0;t--)p[t].pause()}},i.resume=function(){if(_){_=!1;for(var t=p.length-1;t>=0;t--)p[t].resume()}},i.create=function(){return new i},i.resolve=function(){function t(){if(document.currentScript)return document.currentScript.src;var t;try{var i=new Error;if(!i.stack)throw i;t=i.stack}catch(i){t=i.stack}if("string"==typeof t){t=t.split("\n");for(var n=t.length;n--;){var r=t[n].match(/(\w+\:\/\/[^\/]*?\/.+?)(:\d+)(:\d+)?/);if(r)return r[1]}}if(e.length&&"readyState"in e[0])for(var n=e.length;n--;)if("interactive"===e[n].readyState)return e[n].src;return location.href}if("undefined"==typeof window||"undefined"==typeof document)return function(t){return t};var e=document.getElementsByTagName("script");return function(e){if(/^\.\//.test(e)){var i=t(),n=i.substring(0,i.lastIndexOf("/")+1);e=n+e.substring(2)}return e}}(),e.exports=i},{"./util/await":21,"./util/extend":24,"./util/is":25,"./util/stats":29}],9:[function(t){t("./util/event")(t("./core").prototype,function(t,e,i){t._flag(e,i)})},{"./core":8,"./util/event":23}],10:[function(t){function e(){e._super.call(this),this.label("Image"),this._textures=[],this._image=null}var i=t("./core");t("./pin"),t("./loop");var n=t("./util/repeat"),r=t("./util/create");i.image=function(t){var i=new e;return t&&i.image(t),i},e._super=i,e.prototype=r(e._super.prototype),e.prototype.setImage=function(t,e,i){return this.image(t,e,i)},e.prototype.image=function(t){return this._image=i.texture(t).one(),this.pin("width",this._image?this._image.width:0),this.pin("height",this._image?this._image.height:0),this._textures[0]=this._image.pipe(),this._textures.length=1,this},e.prototype.tile=function(t){return this._repeat(!1,t),this},e.prototype.stretch=function(t){return this._repeat(!0,t),this},e.prototype._repeat=function(t,e){function i(t,e,i,n,s,o,h,a,u){var f=r._textures.length>t?r._textures[t]:r._textures[t]=r._image.pipe();f.src(e,i,n,s),f.dest(o,h,a,u)}var r=this;this.untick(this._repeatTicker),this.tick(this._repeatTicker=function(){if(this._mo_stretch!=this._pin._ts_transform){this._mo_stretch=this._pin._ts_transform;var r=this.pin("width"),s=this.pin("height");this._textures.length=n(this._image,r,s,t,e,i)}})}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/repeat":28}],11:[function(t,e){e.exports=t("./core"),e.exports.Matrix=t("./matrix"),e.exports.Texture=t("./texture"),t("./atlas"),t("./tree"),t("./event"),t("./pin"),t("./loop"),t("./root")},{"./atlas":6,"./core":8,"./event":9,"./loop":14,"./matrix":15,"./pin":16,"./root":17,"./texture":19,"./tree":20}],12:[function(t){var e=t("./core");t("./pin"),t("./loop");t("./util/create");e.row=function(t){return e.create().row(t).label("Row")},e.prototype.row=function(t){return this.sequence("row",t),this},e.column=function(t){return e.create().column(t).label("Row")},e.prototype.column=function(t){return this.sequence("column",t),this},e.sequence=function(t,i){return e.create().sequence(t,i).label("Sequence")},e.prototype.sequence=function(t,e){return this._padding=this._padding||0,this._spacing=this._spacing||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_seq!=this._ts_touch){this._mo_seq=this._ts_touch;var i=this._mo_seqAlign!=this._ts_children;this._mo_seqAlign=this._ts_children;for(var n,r=0,s=0,o=this.first(!0),h=!0;n=o;){o=n.next(!0),n.matrix(!0);var a=n.pin("boxWidth"),u=n.pin("boxHeight");"column"==t?(!h&&(s+=this._spacing),n.pin("offsetY")!=s&&n.pin("offsetY",s),r=Math.max(r,a),s+=u,i&&n.pin("alignX",e)):"row"==t&&(!h&&(r+=this._spacing),n.pin("offsetX")!=r&&n.pin("offsetX",r),r+=a,s=Math.max(s,u),i&&n.pin("alignY",e)),h=!1}r+=2*this._padding,s+=2*this._padding,this.pin("width")!=r&&this.pin("width",r),this.pin("height")!=s&&this.pin("height",s)}}),this},e.box=function(){return e.create().box().label("Box")},e.prototype.box=function(){return this._padding=this._padding||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_box!=this._ts_touch){this._mo_box=this._ts_touch;for(var t,e=0,i=0,n=this.first(!0);t=n;){n=t.next(!0),t.matrix(!0);var r=t.pin("boxWidth"),s=t.pin("boxHeight");e=Math.max(e,r),i=Math.max(i,s)}e+=2*this._padding,i+=2*this._padding,this.pin("width")!=e&&this.pin("width",e),this.pin("height")!=i&&this.pin("height",i)}}),this},e.layer=function(){return e.create().layer().label("Layer")},e.prototype.layer=function(){return this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){var t=this.parent();if(t){var e=t.pin("width");this.pin("width")!=e&&this.pin("width",e);var i=t.pin("height");this.pin("height")!=i&&this.pin("height",i)}},!0),this},e.prototype.padding=function(t){return this._padding=t,this},e.prototype.spacing=function(t){return this._spacing=t,this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22}],13:[function(t){function e(t,e){function i(){o.isFast?(o.clear(),o.setTransform(1,0,0,1,0,0)):(o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,a,u)),d.render(o)}function r(){h?(a=window.innerWidth>0?window.innerWidth:screen.width,u=window.innerHeight>0?window.innerHeight:screen.height,s.style.width=a+"px",s.style.height=u+"px"):(a=s.clientWidth,u=s.clientHeight),a*=f,u*=f,(s.width!==a||s.height!==u)&&(s.width=a,s.height=u,DEBUG&&console.log("Resize: "+a+" x "+u+" / "+f),d.viewport(a,u,f),i())}e=e||{};var s=e.canvas,o=null,h=!1,a=0,u=0,f=1;if("string"==typeof s&&(s=document.getElementById(s)),s||(s=document.getElementById("cutjs")||document.getElementById("stage")),!s){h=!0,DEBUG&&console.log("Creating Canvas..."),s=document.createElement("canvas"),s.style.position="absolute";var c=document.body;c.insertBefore(s,c.firstChild)}o=s.getContext("2d",{fastcontext:!0}),o.isFast=!!o.isFast,h=h||o.isFast,DEBUG&&console.log("FastContext: "+o.isFast);var p=window.devicePixelRatio||1,l=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;f=p/l;var _=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)};DEBUG&&console.log("Creating stage...");var d=n.root(_,i);d.background=function(t){return o.isFast?o.setBackgroundColor&&o.setBackgroundColor(t):s.style.backgroundColor=t,this},t(d,s),r(),window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1)}function i(t,e,i){function n(){e(r)}DEBUG&&console.log("Loading image: "+t);var r;FastContext?r=FastContext.createImage(t,n,i):(r=new Image,r.onload=n,r.onerror=i,r.src=t)}"undefined"==typeof DEBUG&&(DEBUG=!0);var n=t("../core"),r=t("../util/once");"undefined"==typeof FastContext&&(FastContext=window.FastContext),window.addEventListener("load",function(){DEBUG&&console.log("On load.");var t=r(function(t){DEBUG&&t&&console.log("Started on "+t),n.start()});document.addEventListener("click",function(){t("click")},!1),document.addEventListener("mousemove",function(){t("mousemove")},!1),document.addEventListener("deviceready",function(){t("deviceready")},!1),document.addEventListener("pause",function(){n.pause()},!1),document.addEventListener("resume",function(){n.resume()},!1)},!1),n.config({"app-loader":e,"image-loader":i})},{"../core":8,"../util/once":27}],14:[function(t){var e=t("./core");t("./pin");var i=t("./util/stats");e.prototype._textures=null,e.prototype._alpha=1,e.prototype.render=function(t){if(this._visible){i.node++;var e=this.matrix();t.setTransform(e.a,e.b,e.c,e.d,e.e,e.f),this._alpha=this._pin._alpha*(this._parent?this._parent._alpha:1);var n=this._pin._textureAlpha*this._alpha;if(t.globalAlpha!=n&&(t.globalAlpha=n),null!==this._textures)for(var r=0,s=this._textures.length;s>r;r++)this._textures[r].draw(t);t.globalAlpha!=this._alpha&&(t.globalAlpha=this._alpha);for(var o,h=this._first;o=h;)h=o._next,o.render(t)}},e.prototype._tickBefore=null,e.prototype._tickAfter=null,e.prototype.MAX_ELAPSE=1/0,e.prototype._tick=function(t,e,n){if(this._visible){t>this.MAX_ELAPSE&&(t=this.MAX_ELAPSE);var r=!1;if(null!==this._tickBefore)for(var s=0,o=this._tickBefore.length;o>s;s++)i.tick++,r=this._tickBefore[s].call(this,t,e,n)===!0||r;for(var h,a=this._first;h=a;)a=h._next,h._flag("_tick")&&(r=h._tick(t,e,n)===!0?!0:r);if(null!==this._tickAfter)for(var s=0,o=this._tickAfter.length;o>s;s++)i.tick++,r=this._tickAfter[s].call(this,t,e,n)===!0||r;return r}},e.prototype.tick=function(t,e){"function"==typeof t&&(e?(null===this._tickBefore&&(this._tickBefore=[]),this._tickBefore.push(t)):(null===this._tickAfter&&(this._tickAfter=[]),this._tickAfter.push(t)),this._flag("_tick",null!==this._tickAfter&&this._tickAfter.length>0||null!==this._tickBefore&&this._tickBefore.length>0))},e.prototype.untick=function(t){if("function"==typeof t){var e;null!==this._tickBefore&&(e=this._tickBefore.indexOf(t))>=0&&this._tickBefore.splice(e,1),null!==this._tickAfter&&(e=this._tickAfter.indexOf(t))>=0&&this._tickAfter.splice(e,1)}},e.prototype.timeout=function(t,e){this.tick(function i(n){return(e-=n)<0?(this.untick(i),void t.call(this)):!0})}},{"./core":8,"./pin":16,"./util/stats":29}],15:[function(t,e){function i(t,e,i,n,r,s){this.reset(t,e,i,n,r,s)}i.prototype.toString=function(){return"["+this.a+", "+this.b+", "+this.c+", "+this.d+", "+this.e+", "+this.f+"]"},i.prototype.clone=function(){return new i(this.a,this.b,this.c,this.d,this.e,this.f)},i.prototype.reset=function(t,e,i,n,r,s){return this._dirty=!0,"object"==typeof t?(this.a=t.a,this.d=t.d,this.b=t.b,this.c=t.c,this.e=t.e,this.f=t.f):(this.a=t||1,this.d=n||1,this.b=e||0,this.c=i||0,this.e=r||0,this.f=s||0),this},i.prototype.identity=function(){return this._dirty=!0,this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this},i.prototype.rotate=function(t){if(!t)return this;this._dirty=!0;var e=t?Math.cos(t):1,i=t?Math.sin(t):0,n=e*this.a-i*this.b,r=e*this.b+i*this.a,s=e*this.c-i*this.d,o=e*this.d+i*this.c,h=e*this.e-i*this.f,a=e*this.f+i*this.e;return this.a=n,this.b=r,this.c=s,this.d=o,this.e=h,this.f=a,this},i.prototype.translate=function(t,e){return t||e?(this._dirty=!0,this.e+=t,this.f+=e,this):this},i.prototype.scale=function(t,e){return t-1||e-1?(this._dirty=!0,this.a*=t,this.b*=e,this.c*=t,this.d*=e,this.e*=t,this.f*=e,this):this},i.prototype.skew=function(t,e){if(!t&&!e)return this;this._dirty=!0;var i=this.a+this.b*t,n=this.b+this.a*e,r=this.c+this.d*t,s=this.d+this.c*e,o=this.e+this.f*t,h=this.f+this.e*e;return this.a=i,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},i.prototype.concat=function(t){this._dirty=!0;var e=this,i=e.a*t.a+e.b*t.c,n=e.b*t.d+e.a*t.b,r=e.c*t.a+e.d*t.c,s=e.d*t.d+e.c*t.b,o=e.e*t.a+t.e+e.f*t.c,h=e.f*t.d+t.f+e.e*t.b;return this.a=i,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},i.prototype.inverse=i.prototype.reverse=function(){if(this._dirty){this._dirty=!1,this.inversed=this.inversed||new i;var t=this.a*this.d-this.b*this.c;this.inversed.a=this.d/t,this.inversed.b=-this.b/t,this.inversed.c=-this.c/t,this.inversed.d=this.a/t,this.inversed.e=(this.c*this.f-this.e*this.d)/t,this.inversed.f=(this.e*this.b-this.a*this.f)/t}return this.inversed},i.prototype.map=function(t,e){return e=e||{},e.x=this.a*t.x+this.c*t.y+this.e,e.y=this.b*t.x+this.d*t.y+this.f,e},i.prototype.mapX=function(t,e){return"object"==typeof t&&(e=t.y,t=t.x),this.a*t+this.c*e+this.e},i.prototype.mapY=function(t,e){return"object"==typeof t&&(e=t.y,t=t.x),this.b*t+this.d*e+this.f},e.exports=i},{}],16:[function(t,e){function i(t){this._owner=t,this._parent=null,this._relativeMatrix=new s,this._absoluteMatrix=new s,this.reset()}function n(t,e,i,n){var r="number"==typeof e,s="number"==typeof i,h="string"==typeof n;t._ts_transform=++o,r&&(t._scaleX=e/t._width_,t._width=t._width_),s&&(t._scaleY=i/t._height_,t._height=t._height_),r&&s&&h&&("out"==n||"out-crop"==n?t._scaleX=t._scaleY=Math.max(t._scaleX,t._scaleY):("in"==n||"in-pad"==n)&&(t._scaleX=t._scaleY=Math.min(t._scaleX,t._scaleY)),("out-crop"==n||"in-pad"==n)&&(t._width=e/t._scaleX,t._height=i/t._scaleY))}var r=t("./core"),s=t("./matrix"),o=0;r._init(function(){this._pin=new i(this)}),r.prototype.matrix=function(t){return t===!0?this._pin.relativeMatrix():this._pin.absoluteMatrix()},r.prototype.pin=function(t,e){return"object"==typeof t?(this._pin.set(t),this):"string"==typeof t?"undefined"==typeof e?this._pin.get(t):(this._pin.set(t,e),this):"undefined"==typeof t?this._pin:void 0},i.prototype.reset=function(){this._textureAlpha=1,this._alpha=1,this._width=0,this._height=0,this._scaleX=1,this._scaleY=1,this._skewX=0,this._skewY=0,this._rotation=0,this._pivoted=!1,this._pivotX=null,this._pivotY=null,this._handled=!1,this._handleX=0,this._handleY=0,this._aligned=!1,this._alignX=0,this._alignY=0,this._offsetX=0,this._offsetY=0,this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height,this._ts_translate=++o,this._ts_transform=++o,this._ts_matrix=++o},i.prototype._update=function(){return this._parent=this._owner._parent&&this._owner._parent._pin,this._handled&&this._mo_handle!=this._ts_transform&&(this._mo_handle=this._ts_transform,this._ts_translate=++o),this._aligned&&this._parent&&this._mo_align!=this._parent._ts_transform&&(this._mo_align=this._parent._ts_transform,this._ts_translate=++o),this},i.prototype.toString=function(){return this._owner+" ("+(this._parent?this._parent._owner:null)+")"},i.prototype.absoluteMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_matrix:0);if(this._mo_abs==t)return this._absoluteMatrix;this._mo_abs=t;var e=this._absoluteMatrix;return e.reset(this.relativeMatrix()),this._parent&&e.concat(this._parent._absoluteMatrix),this._ts_matrix=++o,e},i.prototype.relativeMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_transform:0);if(this._mo_rel==t)return this._relativeMatrix;this._mo_rel=t;var e=this._relativeMatrix;if(e.identity(),this._pivoted&&e.translate(-this._pivotX*this._width,-this._pivotY*this._height),e.scale(this._scaleX,this._scaleY),e.skew(this._skewX,this._skewY),e.rotate(this._rotation),this._pivoted&&e.translate(this._pivotX*this._width,this._pivotY*this._height),this._pivoted)this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height;else{var i,n;e.a>0&&e.c>0||e.a<0&&e.c<0?(i=0,n=e.a*this._width+e.c*this._height):(i=e.a*this._width,n=e.c*this._height),i>n?(this._boxX=n,this._boxWidth=i-n):(this._boxX=i,this._boxWidth=n-i),e.b>0&&e.d>0||e.b<0&&e.d<0?(i=0,n=e.b*this._width+e.d*this._height):(i=e.b*this._width,n=e.d*this._height),i>n?(this._boxY=n,this._boxHeight=i-n):(this._boxY=i,this._boxHeight=n-i)}return this._x=this._offsetX,this._y=this._offsetY,this._x-=this._boxX+this._handleX*this._boxWidth,this._y-=this._boxY+this._handleY*this._boxHeight,this._aligned&&this._parent&&(this._parent.relativeMatrix(),this._x+=this._alignX*this._parent._width,this._y+=this._alignY*this._parent._height),e.translate(this._x,this._y),this._relativeMatrix},i.prototype.get=function(t){return"function"==typeof h[t]?h[t](this):void 0},i.prototype.set=function(t,e){if("string"==typeof t)"function"==typeof a[t]&&"undefined"!=typeof e&&a[t](this,e);else if("object"==typeof t)for(e in t)"function"==typeof a[e]&&"undefined"!=typeof t[e]&&a[e](this,t[e],t);return this._owner&&(this._owner._ts_pin=++o,this._owner.touch()),this};var h={alpha:function(t){return t._alpha},textureAlpha:function(t){return t._textureAlpha},width:function(t){return t._width},height:function(t){return t._height},boxWidth:function(t){return t._boxWidth},boxHeight:function(t){return t._boxHeight},scaleX:function(t){return t._scaleX},scaleY:function(t){return t._scaleY},skewX:function(t){return t._skewX},skewY:function(t){return t._skewY},rotation:function(t){return t._rotation},pivotX:function(t){return t._pivotX},pivotY:function(t){return t._pivotY},offsetX:function(t){return t._offsetX},offsetY:function(t){return t._offsetY},alignX:function(t){return t._alignX},alignY:function(t){return t._alignY},handleX:function(t){return t._handleX},handleY:function(t){return t._handleY}},a={alpha:function(t,e){t._alpha=e},textureAlpha:function(t,e){t._textureAlpha=e},width:function(t,e){t._width_=e,t._width=e,t._ts_transform=++o},height:function(t,e){t._height_=e,t._height=e,t._ts_transform=++o},scale:function(t,e){t._scaleX=e,t._scaleY=e,t._ts_transform=++o},scaleX:function(t,e){t._scaleX=e,t._ts_transform=++o},scaleY:function(t,e){t._scaleY=e,t._ts_transform=++o},skew:function(t,e){t._skewX=e,t._skewY=e,t._ts_transform=++o},skewX:function(t,e){t._skewX=e,t._ts_transform=++o},skewY:function(t,e){t._skewY=e,t._ts_transform=++o},rotation:function(t,e){t._rotation=e,t._ts_transform=++o},pivot:function(t,e){t._pivotX=e,t._pivotY=e,t._pivoted=!0,t._ts_transform=++o},pivotX:function(t,e){t._pivotX=e,t._pivoted=!0,t._ts_transform=++o},pivotY:function(t,e){t._pivotY=e,t._pivoted=!0,t._ts_transform=++o},offset:function(t,e){t._offsetX=e,t._offsetY=e,t._ts_translate=++o},offsetX:function(t,e){t._offsetX=e,t._ts_translate=++o},offsetY:function(t,e){t._offsetY=e,t._ts_translate=++o},align:function(t,e){this.alignX(t,e),this.alignY(t,e)},alignX:function(t,e){t._alignX=e,t._aligned=!0,t._ts_translate=++o,this.handleX(t,e)},alignY:function(t,e){t._alignY=e,t._aligned=!0,t._ts_translate=++o,this.handleY(t,e) | ||
},handle:function(t,e){this.handleX(t,e),this.handleY(t,e)},handleX:function(t,e){t._handleX=e,t._handled=!0,t._ts_translate=++o},handleY:function(t,e){t._handleY=e,t._handled=!0,t._ts_translate=++o},resizeMode:function(t,e,i){i&&("in"==e?e="in-pad":"out"==e&&(e="out-crop"),n(t,i.resizeWidth,i.resizeHeight,e))},resizeWidth:function(t,e,i){i&&i.resizeMode||n(t,e,null)},resizeHeight:function(t,e,i){i&&i.resizeMode||n(t,null,e)},scaleMode:function(t,e,i){i&&n(t,i.scaleWidth,i.scaleHeight,e)},scaleWidth:function(t,e,i){i&&i.scaleMode||n(t,e,null)},scaleHeight:function(t,e,i){i&&i.scaleMode||n(t,null,e)},matrix:function(t,e){this.scaleX(t,e.a),this.skewX(t,e.c/e.d),this.skewY(t,e.b/e.a),this.scaleY(t,e.d),this.offsetX(t,e.e),this.offsetY(t,e.f),this.rotation(t,0)}};r.prototype.scaleTo=function(t,e,i){return"object"==typeof t&&(i=e,e=t.y,t=t.x),n(this._pin,t,e,i),this},i._add_shortcuts=function(t){t.prototype.size=function(t,e){return this.pin("width",t),this.pin("height",e),this},t.prototype.width=function(t){return"undefined"==typeof t?this.pin("width"):(this.pin("width",t),this)},t.prototype.height=function(t){return"undefined"==typeof t?this.pin("height"):(this.pin("height",t),this)},t.prototype.offset=function(t,e){return"object"==typeof t&&(e=t.y,t=t.x),this.pin("offsetX",t),this.pin("offsetY",e),this},t.prototype.rotate=function(t){return this.pin("rotation",t),this},t.prototype.skew=function(t,e){return"object"==typeof t?(e=t.y,t=t.x):"undefined"==typeof e&&(e=t),this.pin("skewX",t),this.pin("skewY",e),this},t.prototype.scale=function(t,e){return"object"==typeof t?(e=t.y,t=t.x):"undefined"==typeof e&&(e=t),this.pin("scaleX",t),this.pin("scaleY",e),this},t.prototype.alpha=function(t,e){return this.pin("alpha",t),"undefined"!=typeof e&&this.pin("textureAlpha",e),this}},i._add_shortcuts(r),e.exports=i},{"./core":8,"./matrix":15}],17:[function(t){function e(t,i){e._super.call(this),this.label("Root");var r=!0,s=this,o=0,h=function(e){if(r!==!0){n.tick=n.node=n.draw=0;var a=o||e,u=e-a;o=e;var f=s._tick(u,e,a);s._mo_touch!=s._ts_touch?(s._mo_touch=s._ts_touch,i(s),t(h)):f?t(h):r=!0,n.fps=u?1e3/u:0}};this.start=function(){return this.resume()},this.resume=function(){return r&&(r=!1,t(h)),this},this.pause=function(){return r=!0,this},this.touch_root=this.touch,this.touch=function(){return this.resume(),this.touch_root()}}var i=t("./core");t("./pin"),t("./loop");var n=t("./util/stats"),r=t("./util/create"),s=t("./util/extend");e._super=i,e.prototype=r(e._super.prototype),i.root=function(t,i){return new e(t,i)},e.prototype.background=function(){return this},e.prototype.viewport=function(t,e,i){if("undefined"==typeof t)return s({},this._viewport);this._viewport={width:t,height:e,ratio:i||1},this.viewbox();var n=s({},this._viewport);return this.visit({start:function(t){return t._flag("viewport")?void t.publish("viewport",[n]):!0}}),this},e.prototype.viewbox=function(t,e,i){"number"==typeof t&&"number"==typeof e&&(this._viewbox={width:t,height:e,mode:/^(in|out|in-pad|out-crop)$/.test(i)?i:"in-pad"});var n=this._viewbox,r=this._viewport;return r&&n?(this.pin({width:n.width,height:n.height}),this.scaleTo(r.width,r.height,n.mode)):r&&this.pin({width:r.width,height:r.height}),this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/extend":24,"./util/stats":29}],18:[function(t){function e(){e._super.call(this),this.label("String"),this._textures=[]}var i=t("./core");t("./pin"),t("./loop");var n=t("./util/create"),r=t("./util/is");i.string=function(t){return(new e).frames(t)},e._super=i,e.prototype=n(e._super.prototype),e.prototype.setFont=function(t,e,i){return this.frames(t,e,i)},e.prototype.frames=function(t){return this._textures=[],"string"==typeof t?(t=i.texture(t),this._item=function(e){return t.one(e)}):"object"==typeof t?this._item=function(e){return t[e]}:"function"==typeof t&&(this._item=t),this},e.prototype.setValue=function(t,e,i){return this.value(t,e,i)},e.prototype.value=function(t){if("undefined"==typeof t)return this._value;if(this._value===t)return this;this._value=t,null===t?t="":"string"==typeof t||r.array(t)||(t=t.toString()),this._spacing=this._spacing||0;for(var e=0,i=0,n=0;n<t.length;n++){var s=this._textures[n]=this._item(t[n]);e+=n>0?this._spacing:0,s.dest(e,0),e+=s.width,i=Math.max(i,s.height)}return this.pin("width",e),this.pin("height",i),this._textures.length=t.length,this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/is":25}],19:[function(t,e){function i(t,e){"object"==typeof t&&this.src(t,e)}var n=t("./util/stats"),r=t("./util/math");i.prototype.pipe=function(){return new i(this)},i.prototype.src=function(t,e,i,n){if("object"==typeof t){var r=t,s=e||1;this._image=r,this._sx=this._dx=0,this._sy=this._dy=0,this._sw=this._dw=r.width/s,this._sh=this._dh=r.height/s,this.width=r.width/s,this.height=r.height/s,this.ratio=s}else"undefined"==typeof i?(i=t,n=e):(this._sx=t,this._sy=e),this._sw=this._dw=i,this._sh=this._dh=n,this.width=i,this.height=n;return this},i.prototype.dest=function(t,e,i,n){return this._dx=t,this._dy=e,this._dx=t,this._dy=e,"undefined"!=typeof i&&(this._dw=i,this._dh=n,this.width=i,this.height=n),this},i.prototype.draw=function(t,e,i,s,o,h,a,u,f){var c=this._image;if(null!==c&&"object"==typeof c){var p=this._sx,l=this._sy,_=this._sw,d=this._sh,g=this._dx,y=this._dy,m=this._dw,v=this._dh;"undefined"!=typeof h?(e=r.limit(e,0,this._sw),s=r.limit(s,0,this._sw-e),i=r.limit(i,0,this._sh),o=r.limit(o,0,this._sh-i),p+=e,l+=i,_=s,d=o,g=h,y=a,m=u,v=f):"undefined"!=typeof s?(g=e,y=i,m=s,v=o):"undefined"!=typeof e&&(m=e,v=i);var x=this.ratio||1;p*=x,l*=x,_*=x,d*=x;try{"function"==typeof c.draw?c.draw(t,p,l,_,d,g,y,m,v):(n.draw++,t.drawImage(c,p,l,_,d,g,y,m,v))}catch(b){c._draw_failed||(console.log("Unable to draw: ",c),console.log(b),c._draw_failed=!0)}}},e.exports=i},{"./util/math":26,"./util/stats":29}],20:[function(t,e){function i(t,e){o(e),o(t),e.remove(),t._last&&(t._last._next=e,e._prev=t._last),e._parent=t,t._last=e,t._first||(t._first=e),e._parent._flag(e,!0),e._ts_parent=++u,t._ts_children=++u,t.touch()}function n(t,e){o(e),o(t),e.remove(),t._first&&(t._first._prev=e,e._next=t._first),e._parent=t,t._first=e,t._last||(t._last=e),e._parent._flag(e,!0),e._ts_parent=++u,t._ts_children=++u,t.touch()}function r(t,e){o(t),o(e),t.remove();var i=e._parent,n=e._prev;e._prev=t,n&&(n._next=t)||i&&(i._first=t),t._parent=i,t._prev=n,t._next=e,t._parent._flag(t,!0),t._ts_parent=++u,t.touch()}function s(t,e){o(t),o(e),t.remove();var i=e._parent,n=e._next;e._next=t,n&&(n._prev=t)||i&&(i._last=t),t._parent=i,t._prev=e,t._next=n,t._parent._flag(t,!0),t._ts_parent=++u,t.touch()}function o(t){if(t&&t instanceof h)return t;throw"Invalid node: "+t}var h=t("./core"),a=t("./util/is"),u=0;h.prototype._label="",h.prototype._visible=!0,h.prototype._parent=null,h.prototype._next=null,h.prototype._prev=null,h.prototype._first=null,h.prototype._last=null,h.prototype._attrs=null,h.prototype._flags=null,h.prototype.toString=function(){return"["+this._label+"]"},h.prototype.id=function(t){return this.label(t)},h.prototype.label=function(t){return"undefined"==typeof t?this._label:(this._label=t,this)},h.prototype.attr=function(t,e){return"undefined"==typeof e?null!==this._attrs?this._attrs[t]:void 0:((null!==this._attrs?this._attrs:this._attrs={})[t]=e,this)},h.prototype.visible=function(t){return"undefined"==typeof t?this._visible:(this._visible=t,this._parent&&(this._parent._ts_children=++u),this._ts_pin=++u,this.touch(),this)},h.prototype.hide=function(){return this.visible(!1)},h.prototype.show=function(){return this.visible(!0)},h.prototype.parent=function(){return this._parent},h.prototype.next=function(t){for(var e=this._next;e&&t&&!e._visible;)e=e._next;return e},h.prototype.prev=function(t){for(var e=this._prev;e&&t&&!e._visible;)e=e._prev;return e},h.prototype.first=function(t){for(var e=this._first;e&&t&&!e._visible;)e=e._next;return e},h.prototype.last=function(t){for(var e=this._last;e&&t&&!e._visible;)e=e._prev;return e},h.prototype.visit=function(t,e){var i=t.reverse,n=t.visible;if(!t.start||!t.start(this,e)){for(var r,s=i?this.last(n):this.first(n);r=s;)if(s=i?r.prev(n):r.next(n),r.visit(t,e))return!0;return t.end&&t.end(this,e)}},h.prototype.append=function(t,e){if(a.array(t))for(var n=0;n<t.length;n++)i(this,t[n]);else if("undefined"!=typeof e)for(var n=0;n<arguments.length;n++)i(this,arguments[n]);else"undefined"!=typeof t&&i(this,t);return this},h.prototype.prepend=function(t,e){if(a.array(t))for(var i=t.length-1;i>=0;i--)n(this,t[i]);else if("undefined"!=typeof e)for(var i=arguments.length-1;i>=0;i--)n(this,arguments[i]);else"undefined"!=typeof t&&n(this,t);return this},h.prototype.appendTo=function(t){return i(t,this),this},h.prototype.prependTo=function(t){return n(t,this),this},h.prototype.insertNext=function(t,e){if(a.array(t))for(var i=0;i<t.length;i++)s(t[i],this);else if("undefined"!=typeof e)for(var i=0;i<arguments.length;i++)s(arguments[i],this);else"undefined"!=typeof t&&s(t,this);return this},h.prototype.insertPrev=function(t,e){if(a.array(t))for(var i=t.length-1;i>=0;i--)r(t[i],this);else if("undefined"!=typeof e)for(var i=arguments.length-1;i>=0;i--)r(arguments[i],this);else"undefined"!=typeof t&&r(t,this);return this},h.prototype.insertAfter=function(t){return s(this,t),this},h.prototype.insertBefore=function(t){return r(this,t),this},h.prototype.remove=function(t,e){if("undefined"!=typeof t){if(a.array(t))for(var i=0;i<t.length;i++)o(t[i]).remove();else if("undefined"!=typeof e)for(var i=0;i<arguments.length;i++)o(arguments[i]).remove();else o(t).remove();return this}return this._prev&&(this._prev._next=this._next),this._next&&(this._next._prev=this._prev),this._parent&&(this._parent._first===this&&(this._parent._first=this._next),this._parent._last===this&&(this._parent._last=this._prev),this._parent._flag(this,!1),this._parent._ts_children=++u,this._parent.touch()),this._prev=this._next=this._parent=null,this._ts_parent=++u,this},h.prototype.empty=function(){for(var t,e=this._first;t=e;)e=t._next,t._prev=t._next=t._parent=null,this._flag(t,!1);return this._first=this._last=null,this._ts_children=++u,this.touch(),this},h.prototype.touch=function(){return this._ts_touch=++u,this._parent&&this._parent.touch(),this},h.prototype._flag=function(t,e){if("undefined"==typeof e)return null!==this._flags&&this._flags[t]||0;if("string"==typeof t&&(e?(this._flags=this._flags||{},!this._flags[t]&&this._parent&&this._parent._flag(t,!0),this._flags[t]=(this._flags[t]||0)+1):this._flags&&this._flags[t]>0&&(1==this._flags[t]&&this._parent&&this._parent._flag(t,!1),this._flags[t]=this._flags[t]-1)),"object"==typeof t&&t._flags)for(var i in t._flags)t._flags[i]>0&&this._flag(i,e);return this},h.prototype.hitTest=function(t){return this.attr("spy")?!0:t.x>=0&&t.x<=this._pin._width&&t.y>=0&&t.y<=this._pin._height},e.exports=h},{"./core":8,"./util/is":25}],21:[function(t,e){e.exports=function(){function t(t,n){return i+=n="number"==typeof n&&n>=1?n:1,function(){t&&t.apply(this,arguments),n>0&&(n--,i--,e())}}function e(){if(0===i)for(;n.length;)setTimeout(n.shift(),0)}var i=0,n=[];return t.then=function(t){0===i?setTimeout(t,0):n.push(t)},t}},{}],22:[function(t,e){function i(){}e.exports="function"==typeof Object.create?function(t,e){return Object.create.call(Object,t,e)}:function(t,e){if(e)throw Error("Second argument is not supported!");if("object"!=typeof t||null===t)throw Error("Invalid prototype!");return i.prototype=t,new i}},{}],23:[function(t,e){e.exports=function(t,e){t._listeners=null,t.on=t.listen=function(t,i){if(!t||!t.length||"function"!=typeof i)return this;null===this._listeners&&(this._listeners={});var n="string"!=typeof t&&"function"==typeof t.join;if(t=(n?t.join(" "):t).match(/\S+/g))for(var r=0;r<t.length;r++){var s=t[r];this._listeners[s]=this._listeners[s]||[],this._listeners[s].push(i),"function"==typeof e&&e(this,s,!0)}return this},t.off=function(t,i){if(!t||!t.length||"function"!=typeof i)return this;if(null===this._listeners)return this;var n="string"!=typeof t&&"function"==typeof t.join;if(t=(n?t.join(" "):t).match(/\S+/g))for(var r=0;r<t.length;r++){var s,o=t[r],h=this._listeners[o];h&&(s=h.indexOf(i))>=0&&(h.splice(s,1),h.length||delete this._listeners[o],"function"==typeof e&&e(this,o,!1))}return this},t.listeners=function(t){return this._listeners&&this._listeners[t]},t.publish=function(t,e){var i=this.listeners(t);if(!i||!i.length)return 0;for(var n=0;n<i.length;n++)i[n].apply(this,e);return i.length},t.trigger=function(t,e){return this.publish(t,e),this}}},{}],24:[function(t,e){e.exports=function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}return t}},{}],25:[function(t,e){var i=Object.prototype,n=i.hasOwnProperty,r=i.toString,s=/^[A-Fa-f0-9]+$/,o=e.exports={};o.a=o.an=o.type=function(t,e){return typeof t===e},o.defined=function(t){return"undefined"!=typeof t},o.empty=function(t){var e,i=r.call(t);if("[object Array]"===i||"[object Arguments]"===i||"[object String]"===i)return 0===t.length;if("[object Object]"===i){for(e in t)if(n.call(t,e))return!1;return!0}return!t},o.equal=function(t,e){if(t===e)return!0;var i,n=r.call(t);if(n!==r.call(e))return!1;if("[object Object]"===n){for(i in t)if(!(o.equal(t[i],e[i])&&i in e))return!1;for(i in e)if(!(o.equal(t[i],e[i])&&i in t))return!1;return!0}if("[object Array]"===n){if(i=t.length,i!==e.length)return!1;for(;--i;)if(!o.equal(t[i],e[i]))return!1;return!0}return"[object Function]"===n?t.prototype===e.prototype:"[object Date]"===n?t.getTime()===e.getTime():!1},o.instance=function(t,e){return t instanceof e},o.nil=function(t){return null===t},o.undef=function(t){return"undefined"==typeof t},o.array=function(t){return"[object Array]"===r.call(t)},o.emptyarray=function(t){return o.array(t)&&0===t.length},o.arraylike=function(t){return!!t&&!o["boolean"](t)&&n.call(t,"length")&&isFinite(t.length)&&o.number(t.length)&&t.length>=0},o["boolean"]=function(t){return"[object Boolean]"===r.call(t)},o.element=function(t){return void 0!==t&&"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&1===t.nodeType},o.fn=function(t){return"[object Function]"===r.call(t)},o.number=function(t){return"[object Number]"===r.call(t)},o.nan=function(t){return!o.number(t)||t!==t},o.object=function(t){return"[object Object]"===r.call(t)},o.hash=function(t){return o.object(t)&&t.constructor===Object&&!t.nodeType&&!t.setInterval},o.regexp=function(t){return"[object RegExp]"===r.call(t)},o.string=function(t){return"[object String]"===r.call(t)},o.hex=function(t){return o.string(t)&&(!t.length||s.test(t))}},{}],26:[function(t,e){var i=t("./create"),n=Math;e.exports=i(Math),e.exports.random=function(t,e){return"undefined"==typeof t?(e=1,t=0):"undefined"==typeof e&&(e=t,t=0),t==e?t:n.random()*(e-t)+t},e.exports.rotate=function(t,e,i){return"undefined"==typeof e?(i=1,e=0):"undefined"==typeof i&&(i=e,e=0),i>e?(t=(t-e)%(i-e),t+(0>t?i:e)):(t=(t-i)%(e-i),t+(0>=t?e:i))},e.exports.limit=function(t,e,i){return e>t?e:t>i?i:t},e.exports.length=function(t,e){return n.sqrt(t*t+e*e)}},{"./create":22}],27:[function(t,e){e.exports=function(t,e){var i=!1;return function(){i||(i=!0,t.apply(e,arguments))}}},{}],28:[function(t,e){e.exports=function(t,e,i,n,r,s){var o=t.width,h=t.height,a=t.left,u=t.right,f=t.top,c=t.bottom;a="number"==typeof a&&a===a?a:0,u="number"==typeof u&&u===u?u:0,f="number"==typeof f&&f===f?f:0,c="number"==typeof c&&c===c?c:0,o=o-a-u,h=h-f-c,r||(e=Math.max(e-a-u,0),i=Math.max(i-f-c,0));var p=0;if(f>0&&a>0&&s(p++,0,0,a,f,0,0,a,f),c>0&&a>0&&s(p++,0,h+f,a,c,0,i+f,a,c),f>0&&u>0&&s(p++,o+a,0,u,f,e+a,0,u,f),c>0&&u>0&&s(p++,o+a,h+f,u,c,e+a,i+f,u,c),n)f>0&&s(p++,a,0,o,f,a,0,e,f),c>0&&s(p++,a,h+f,o,c,a,i+f,e,c),a>0&&s(p++,0,f,a,h,0,f,a,i),u>0&&s(p++,o+a,f,u,h,e+a,f,u,i),s(p++,a,f,o,h,a,f,e,i);else for(var l,_=a,d=e;d>0;){l=Math.min(o,d),d-=o;for(var g,y=f,m=i;m>0;)g=Math.min(h,m),m-=h,s(p++,a,f,l,g,_,y,l,g),0>=d&&(a&&s(p++,0,f,a,g,0,y,a,g),u&&s(p++,o+a,f,u,g,_+l,y,u,g)),y+=g;f&&s(p++,a,0,l,f,_,0,l,f),c&&s(p++,a,h+f,l,c,_,y,l,c),_+=l}return p}},{}],29:[function(t,e){e.exports={}},{}],30:[function(t,e){e.exports.startsWith=function(t,e){return"string"==typeof t&&"string"==typeof e&&t.substring(0,e.length)==e}},{}]},{},[1])(1)}); |
8
dist/stage.web.js
4
dist/stage.web.min.js
@@ -1,8 +1,8 @@ | ||
/* | ||
- * Stage.js 0.8.2 | ||
+ * Stage.js 0.8.4 | ||
* | ||
* @copyright 2015 Ali Shakiba, Piqnt LLC | ||
* @license The MIT License | ||
*/ | ||
-!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:"undefined"!=typeof global?i=global:"undefined"!=typeof self&&(i=self),i.Stage=t()}}(function(){return function t(i,e,n){function r(o,h){if(!e[o]){if(!i[o]){var a="function"==typeof require&&require;if(!h&&a)return a(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=e[o]={exports:{}};i[o][0].call(f.exports,function(t){var e=i[o][1][t];return r(e?e:t)},f,f.exports,t,i,e,n)}return e[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,i){i.exports=t("../lib/"),t("../lib/canvas"),t("../lib/image"),t("../lib/anim"),t("../lib/str"),t("../lib/layout"),t("../lib/addon/tween"),i.exports.Mouse=t("../lib/addon/mouse"),i.exports.Math=t("../lib/util/math"),i.exports._extend=t("../lib/util/extend"),i.exports._create=t("../lib/util/create"),t("../lib/loader/web")},{"../lib/":11,"../lib/addon/mouse":3,"../lib/addon/tween":4,"../lib/anim":5,"../lib/canvas":7,"../lib/image":10,"../lib/layout":12,"../lib/loader/web":13,"../lib/str":18,"../lib/util/create":22,"../lib/util/extend":24,"../lib/util/math":26}],2:[function(t,i){function e(t){return t}function n(t){if("function"==typeof t)return t;if("string"!=typeof t)return e;var i=r[t];if(i)return i;var n=/^(\w+)(-(in|out|in-out|out-in))?(\((.*)\))?$/i.exec(t);return n&&n.length?(easing=o[n[1]],mode=s[n[3]],params=n[5],i=easing&&easing.fn?easing.fn:easing&&easing.fc?easing.fc.apply(easing.fc,params&¶ms.replace(/\s+/,"").split(",")):e,mode&&(i=mode.fn(i)),r[t]=i,i):e}var r={},s={},o={};n.add=function(t){for(var i=(t.name||t.mode).split(/\s+/),e=0;e<i.length;e++){var n=i[e];n&&((t.name?o:s)[n]=t)}},n.add({mode:"in",fn:function(t){return t}}),n.add({mode:"out",fn:function(t){return function(i){return 1-t(1-i)}}}),n.add({mode:"in-out",fn:function(t){return function(i){return.5>i?t(2*i)/2:1-t(2*(1-i))/2}}}),n.add({mode:"out-in",fn:function(t){return function(i){return.5>i?1-t(2*(1-i))/2:t(2*i)/2}}}),n.add({name:"linear",fn:function(t){return t}}),n.add({name:"quad",fn:function(t){return t*t}}),n.add({name:"cubic",fn:function(t){return t*t*t}}),n.add({name:"quart",fn:function(t){return t*t*t*t}}),n.add({name:"quint",fn:function(t){return t*t*t*t*t}}),n.add({name:"sin sine",fn:function(t){return 1-Math.cos(t*Math.PI/2)}}),n.add({name:"exp expo",fn:function(t){return 0==t?0:Math.pow(2,10*(t-1))}}),n.add({name:"circle circ",fn:function(t){return 1-Math.sqrt(1-t*t)}}),n.add({name:"bounce",fn:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}}),n.add({name:"poly",fc:function(t){return function(i){return Math.pow(i,t)}}}),n.add({name:"elastic",fc:function(t,i){i=i||.45,t=t||1;var e=i/(2*Math.PI)*Math.asin(1/t);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin(2*(n-e)*Math.PI/i)}}}),n.add({name:"back",fc:function(t){return t="undefined"!=typeof t?t:1.70158,function(i){return i*i*((t+1)*i-t)}}}),i.exports=n},{}],3:[function(t,i){function e(t,i){if(this instanceof e){var n=t.viewport().ratio||1;t.on("viewport",function(t){n=t.ratio||n}),this.x=0,this.y=0,this.toString=function(){return(0|this.x)+"x"+(0|this.y)},this.locate=function(t){r(i,t,this),this.x*=n,this.y*=n},this.lookup=function(i,e){this.type=i,this.root=t,this.event=null,e.length=0,this.collect=e,this.root.visit(this.visitor,this)},this.publish=function(i,e,n){if(this.type=i,this.root=t,this.event=e,this.collect=!1,this.timeStamp=Date.now(),"mousemove"!==i&&"touchmove"!==i&&DEBUG&&console.log(this.type+" "+this),n){for(;n.length&&!this.visitor.end(n.shift(),this););n.length=0}else this.root.visit(this.visitor,this)},this.visitor={reverse:!0,visible:!0,start:function(t,i){return!t._flag(i.type)},end:function(t,i){s.raw=i.event,s.type=i.type,s.timeStamp=i.timeStamp,s.abs.x=i.x,s.abs.y=i.y;var e=t.listeners(i.type);if(e&&(t.matrix().inverse().map(i,s),(t===i.root||t.hitTest(s))&&(i.collect&&i.collect.push(t),i.event))){for(var n=!1,r=0;r<e.length;r++)n=e[r].call(t,s)?!0:n;return n}}}}}function n(t,i,e){Object.defineProperty(t,i,{value:e})}function r(t,i,e){i.touches&&i.touches.length?(e.x=i.touches[0].clientX,e.y=i.touches[0].clientY):(e.x=i.clientX,e.y=i.clientY);var n=t.getBoundingClientRect();return e.x-=n.left,e.y-=n.top,e.x-=0|t.clientLeft,e.y-=0|t.clientTop,e}"undefined"==typeof DEBUG&&(DEBUG=!0),t("../core")._load(function(t,i){e.subscribe(t,i)}),e.CLICK="click",e.START="touchstart mousedown",e.MOVE="touchmove mousemove",e.END="touchend mouseup",e.CANCEL="touchcancel mousecancel",e.subscribe=function(t,i){function n(i){i.preventDefault(),t.mouse.locate(i),t.mouse.publish(i.type,i),t.mouse.lookup("click",h),t.mouse.lookup("mousecancel",a)}function r(i){i.preventDefault(),t.mouse.locate(i),t.mouse.publish(i.type,i)}function s(i){i.preventDefault(),t.mouse.publish(i.type,i),h.length&&t.mouse.publish("click",i,h),a.length=0}function o(i){a.length&&t.mouse.publish("mousecancel",i,a),h.length=0}if(!t.mouse){t.mouse=new e(t,i),i.addEventListener("touchstart",n),i.addEventListener("touchend",s),i.addEventListener("touchmove",r),i.addEventListener("touchcancel",o),i.addEventListener("mousedown",n),i.addEventListener("mouseup",s),i.addEventListener("mousemove",r),document.addEventListener("mouseup",o),window.addEventListener("blur",o);var h=[],a=[]}};var s={},o={};n(s,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(s,"toString",function(){return(0|this.x)+"x"+(0|this.y)+" ("+this.abs+")"}),n(s,"abs",o),n(o,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(o,"toString",function(){return(0|this.x)+"x"+(0|this.y)}),i.exports=e},{"../core":8}],4:[function(t,i){function e(t,i,e){this._end={},this._duration=i||400,this._delay=e||0,this._owner=t,this._time=0}function n(t,i,e,n){"number"==typeof t.pin(e)?i[e]=n:"number"==typeof t.pin(e+"X")&&"number"==typeof t.pin(e+"Y")&&(i[e+"X"]=n,i[e+"Y"]=n)}var r=t("./easing"),s=t("../core"),o=t("../pin");s.prototype.tween=function(t,i,n){if("number"!=typeof t?(n=t,i=0,t=0):"number"!=typeof i&&(n=i,i=0),!this._tweens){this._tweens=[];var r=0;this.tick(function(t,i,e){if(this._tweens.length){var n=r!=e;if(r=i,n)return!0;var s=this._tweens[0].tick(this,t,i,e);return s&&this._tweens.shift(),"object"==typeof s&&this._tweens.unshift(s),!0}},!0)}this.touch(),n||(this._tweens.length=0);var s=new e(this,t,i);return this._tweens.push(s),s},e.prototype.tick=function(t,i){if(this._time+=i,!(this._time<this._delay)){var e=this._time-this._delay;if(!this._start){this._start={};for(var n in this._end)this._start[n]=this._owner.pin(n)}var r,s;e<this._duration?(r=e/this._duration,s=!1):(r=1,s=!0),r="function"==typeof this._easing?this._easing(r):r;var o=1-r;for(var n in this._end)this._owner.pin(n,this._start[n]*o+this._end[n]*r);if(s){try{this._done&&this._done.call(this._owner)}catch(h){console.log(h)}return this._next||!0}}},e.prototype.tween=function(t,i){return this._next=new e(this._owner,t,i)},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.delay=function(t){return this._delay=t,this},e.prototype.ease=function(t){return this._easing=r(t),this},e.prototype.done=function(t){return this._done=t,this},e.prototype.hide=function(){return this.done(function(){this.hide()}),this},e.prototype.remove=function(){return this.done(function(){this.remove()}),this},e.prototype.pin=function(t,i){if("object"==typeof t)for(var e in t)n(this._owner,this._end,e,t[e]);else"undefined"!=typeof i&&n(this._owner,this._end,t,i);return this},o._add_shortcuts(e),e.prototype.then=function(t){return this.done(t),this},e.prototype.then=function(t){return this.done(t),this},e.prototype.clear=function(){return this},i.exports=e},{"../core":8,"../pin":16,"./easing":2}],5:[function(t){function i(){i._super.call(this),this.label("Anim"),this._textures=[],this._fps=e.Anim.FPS,this._ft=1e3/this._fps,this._time=-1,this._repeat=0,this._index=0,this._frames=[];var t=0;this.tick(function(i,e,n){if(!(this._time<0||this._frames.length<=1)){var r=t!=n;if(t=e,r)return!0;if(this._time+=i,this._time<this._ft)return!0;var s=this._time/this._ft|0;return this._time-=s*this._ft,this.moveFrame(s),this._repeat>0&&(this._repeat-=s)<=0?(this.stop(),this._callback&&this._callback(),!1):!0}},!1)}var e=t("./core");t("./pin"),t("./loop");var n=t("./util/create"),r=t("./util/math");e.anim=function(t,e){var n=new i;return n.frames(t).gotoFrame(0),e&&n.fps(e),n},i._super=e,i.prototype=n(i._super.prototype),e.Anim={FPS:15},i.prototype.fps=function(t){return"undefined"==typeof t?this._fps:(this._fps=t>0?t:e.Anim.FPS,this._ft=1e3/this._fps,this)},i.prototype.setFrames=function(t,i,e){return this.frames(t,i,e)},i.prototype.frames=function(t){return this._index=0,this._frames=e.texture(t).array(),this.touch(),this},i.prototype.length=function(){return this._frames?this._frames.length:0},i.prototype.gotoFrame=function(t,i){return this._index=0|r.rotate(t,this._frames.length),i=i||!this._textures[0],this._textures[0]=this._frames[this._index],i&&(this.pin("width",this._textures[0].width),this.pin("height",this._textures[0].height)),this.touch(),this},i.prototype.moveFrame=function(t){return this.gotoFrame(this._index+t)},i.prototype.repeat=function(t,i){return this._repeat=t*this._frames.length-1,this._callback=i,this.play(),this},i.prototype.play=function(t){return"undefined"!=typeof t?(this.gotoFrame(t),this._time=0):this._time<0&&(this._time=0),this.touch(),this},i.prototype.stop=function(t){return this._time=-1,"undefined"!=typeof t&&this.gotoFrame(t),this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/math":26}],6:[function(t,i){function e(t){function i(t){if(!t||u.fn(t.draw))return t;t=h({},t),u.fn(a)&&(t=a(t)),1!=c&&(t.x*=c,t.y*=c,t.width*=c,t.height*=c,t.top*=c,t.bottom*=c,t.left*=c,t.right*=c),0!=p&&(t.x+=p,t.y+=p,t.width-=2*p,t.height-=2*p,t.top-=p,t.bottom-=p,t.left-=p,t.right-=p);var i=o.pipe();return i.top=t.top,i.bottom=t.bottom,i.left=t.left,i.right=t.right,i.src(t.x,t.y,t.width,t.height),i}function s(t){if(l){if(u.fn(l))return l(t);if(u.hash(l))return l[t]}if(d){for(var i=null,e=0,n=0;n<d.length;n++)f.startsWith(d[n].name,t)&&(0===e?i=d[n]:1===e?i=[i,d[n]]:i.push(d[n]),e++);return 0===e&&u.fn(_)&&(i=function(i){return _(t+(i?i:""))}),i}}e._super.call(this);var o=this;r(t,"filter"),r(t,"cutouts"),r(t,"sprites"),r(t,"factory");var a=t.map||t.filter,c=t.ppu||t.ratio||1,p=t.trim||0,l=t.textures,_=t.factory,d=t.cutouts||t.sprites;this.select=function(t){if(!t)return new n(this.pipe());var e=s(t);return e?new n(e,s,i):void 0}}function n(t,i,e){function n(t,r){return t?u.fn(t.draw)?t:u.hash(t)&&u.number(t.width)&&u.number(t.height)&&u.fn(e)?e(t):u.hash(t)&&u.defined(r)?n(t[r]):u.fn(t)?n(t(r)):u.array(t)?n(t[0]):u.string(t)&&u.fn(i)?n(i(t)):void 0:l}this.one=function(i){return n(t,i)},this.array=function(i){var e=u.array(i)?i:[];if(u.array(t))for(var r=0;r<t.length;r++)e[r]=n(t[r]);else e[0]=n(t);return e}}function r(t,i,e){i in t&&console.log(e?e.replace("%name",i):"'"+i+"' field of texture atlas is deprecated.")}"undefined"==typeof DEBUG&&(DEBUG=!0);var s=t("./core"),o=t("./texture"),h=t("./util/extend"),a=t("./util/create"),u=t("./util/is"),f=t("./util/string"),c={},p=[];s.atlas=function(t){var i=u.fn(t.draw)?t:new e(t);t.name&&(c[t.name]=i),p.push(i),r(t,"imagePath"),r(t,"imageRatio");var n=t.imagePath,o=t.imageRatio||1;return u.string(t.image)?n=t.image:u.hash(t.image)&&(n=t.image.src||t.image.url,o=t.image.ratio||o),n&&s.preload(function(t){n=s.resolve(n),DEBUG&&console.log("Loading atlas: "+n);var e=s.config("image-loader");e(n,function(e){DEBUG&&console.log("Image loaded: "+n),i.src(e,o),t()},function(i){DEBUG&&console.log("Error loading atlas: "+n,i),t()})}),i},e._super=o,e.prototype=a(e._super.prototype);var l=new o;l.x=l.y=l.width=l.height=0,l.pipe=l.src=l.dest=function(){return this},l.draw=function(){};var _=new n(l);s.texture=function(t){if(!u.string(t))return new n(t);var i,e,r=null;for((e=t.indexOf(":"))>0&&t.length>e+1&&(i=c[t.slice(0,e)],r=i&&i.select(t.slice(e+1))),!r&&(i=c[t])&&(r=i.select()),e=0;!r&&e<p.length;e++)r=p[e].select(t);return r||(console.error("Texture not found: "+t),r=_),r},i.exports=e},{"./core":8,"./texture":19,"./util/create":22,"./util/extend":24,"./util/is":25,"./util/string":29}],7:[function(t){var i=t("./core"),e=t("./texture");i.canvas=function(t,i,n){"string"==typeof t?"object"==typeof i||("function"==typeof i&&(n=i),i={}):("function"==typeof t&&(n=t),i={},t="2d");var r=document.createElement("canvas"),s=r.getContext(t,i),o=new e(r);return o.context=function(){return s},o.size=function(t,i,e){return e=e||1,r.width=t*e,r.height=i*e,this.src(r,e),this},o.canvas=function(t){return"function"==typeof t?t.call(this,s):"undefined"==typeof t&&"function"==typeof n&&n.call(this,s),this},"function"==typeof n&&n.call(o,s),o}},{"./core":8,"./texture":19}],8:[function(t,i){function e(t){if(!(this instanceof e))return o.fn(t)?e.app.apply(e,arguments):o.object(t)?e.atlas.apply(e,arguments):t;r.create++;for(var i=0;i<a.length;i++)a[i].call(this)}function n(t,i){var e=document.createElement("script");e.addEventListener("load",function(){i()}),e.addEventListener("error",function(e){i(e||"Error loading script: "+t)}),e.src=t,e.id="preload-"+Date.now(),document.body.appendChild(e)}"undefined"==typeof DEBUG&&(DEBUG=!0);var r=t("./util/stats"),s=t("./util/extend"),o=t("./util/is"),h=t("./util/await");r.create=0;var a=[];e._init=function(t){a.push(t)};var u=[];e._load=function(t){u.push(t)};var f={};e.config=function(){return 1===arguments.length&&o.string(arguments[0])?f[arguments[0]]:(1===arguments.length&&o.object(arguments[0])&&s(f,arguments[0]),void(2===arguments.length&&o.string(arguments[0])&&f[(arguments[0],arguments[1])]))};var c=[],p=[],l=!1,_=!1;e.app=function(t,i){if(!l)return void c.push(arguments);DEBUG&&console.log("Creating app...");var n=e.config("app-loader");n(function(i,e){DEBUG&&console.log("Initing app...");for(var n=0;n<u.length;n++)u[n].call(this,i,e);t(i,e),p.push(i),DEBUG&&console.log("Starting app..."),i.start()},i)};var d=h();e.preload=function(t){if("string"==typeof t){var i=e.resolve(t);/\.js($|\?|\#)/.test(i)&&(DEBUG&&console.log("Loading script: "+i),t=function(t){n(i,t)})}"function"==typeof t&&t(d())},e.start=function(t){DEBUG&&console.log("Starting..."),e.config(t),d.then(function(){for(DEBUG&&console.log("Loading apps..."),l=!0;c.length;){var t=c.shift();e.app.apply(e,t)}})},e.pause=function(){if(!_){_=!0;for(var t=p.length-1;t>=0;t--)p[t].pause()}},e.resume=function(){if(_){_=!1;for(var t=p.length-1;t>=0;t--)p[t].resume()}},e.create=function(){return new e},e.resolve=function(){function t(){if(document.currentScript)return document.currentScript.src;var t;try{var e=new Error;if(!e.stack)throw e;t=e.stack}catch(e){t=e.stack}if("string"==typeof t){t=t.split("\n");for(var n=t.length;n--;){var r=t[n].match(/(\w+\:\/\/[^\/]*?\/.+?)(:\d+)(:\d+)?/);if(r)return r[1]}}if(i.length&&"readyState"in i[0])for(var n=i.length;n--;)if("interactive"===i[n].readyState)return i[n].src;return location.href}if("undefined"==typeof window||"undefined"==typeof document)return function(t){return t};var i=document.getElementsByTagName("script");return function(i){if(/^\.\//.test(i)){var e=t(),n=e.substring(0,e.lastIndexOf("/")+1);i=n+i.substring(2)}return i}}(),i.exports=e},{"./util/await":21,"./util/extend":24,"./util/is":25,"./util/stats":28}],9:[function(t){t("./util/event")(t("./core").prototype,function(t,i,e){t._flag(i,e)})},{"./core":8,"./util/event":23}],10:[function(t){function i(){i._super.call(this),this.label("Image"),this._textures=[],this._image=null}var e=t("./core");t("./pin"),t("./loop");var n=t("./util/repeat"),r=t("./util/create");e.image=function(t){var e=new i;return t&&e.image(t),e},i._super=e,i.prototype=r(i._super.prototype),i.prototype.setImage=function(t,i,e){return this.image(t,i,e)},i.prototype.image=function(t){return this._image=e.texture(t).one(),this.pin("width",this._image?this._image.width:0),this.pin("height",this._image?this._image.height:0),this._textures[0]=this._image.pipe(),this._textures.length=1,this},i.prototype.tile=function(t){return this._repeat(!1,t),this},i.prototype.stretch=function(t){return this._repeat(!0,t),this},i.prototype._repeat=function(t,i){function e(t,i,e,n,s,o,h,a,u){var f=r._textures.length>t?r._textures[t]:r._textures[t]=r._image.pipe();f.src(i,e,n,s),f.dest(o,h,a,u)}var r=this;this.untick(this._repeatTicker),this.tick(this._repeatTicker=function(){if(this._mo_stretch!=this._pin._ts_transform){this._mo_stretch=this._pin._ts_transform;var r=this.pin("width"),s=this.pin("height");this._textures.length=n(this._image,r,s,t,i,e)}})}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/repeat":27}],11:[function(t,i){i.exports=t("./core"),i.exports.Matrix=t("./matrix"),i.exports.Texture=t("./texture"),t("./atlas"),t("./tree"),t("./event"),t("./pin"),t("./loop"),t("./root")},{"./atlas":6,"./core":8,"./event":9,"./loop":14,"./matrix":15,"./pin":16,"./root":17,"./texture":19,"./tree":20}],12:[function(t){var i=t("./core");t("./pin"),t("./loop");t("./util/create");i.row=function(t){return i.create().row(t).label("Row")},i.prototype.row=function(t){return this.sequence("row",t),this},i.column=function(t){return i.create().column(t).label("Row")},i.prototype.column=function(t){return this.sequence("column",t),this},i.sequence=function(t,e){return i.create().sequence(t,e).label("Sequence")},i.prototype.sequence=function(t,i){return this._padding=this._padding||0,this._spacing=this._spacing||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_seq!=this._ts_touch){this._mo_seq=this._ts_touch;var e=this._mo_seqAlign!=this._ts_children;this._mo_seqAlign=this._ts_children;for(var n,r=0,s=0,o=this.first(!0),h=!0;n=o;){o=n.next(!0),n.matrix(!0);var a=n.pin("boxWidth"),u=n.pin("boxHeight");"column"==t?(!h&&(s+=this._spacing),n.pin("offsetY")!=s&&n.pin("offsetY",s),r=Math.max(r,a),s+=u,e&&n.pin("alignX",i)):"row"==t&&(!h&&(r+=this._spacing),n.pin("offsetX")!=r&&n.pin("offsetX",r),r+=a,s=Math.max(s,u),e&&n.pin("alignY",i)),h=!1}r+=2*this._padding,s+=2*this._padding,this.pin("width")!=r&&this.pin("width",r),this.pin("height")!=s&&this.pin("height",s)}}),this},i.box=function(){return i.create().box().label("Box")},i.prototype.box=function(){return this._padding=this._padding||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_box!=this._ts_touch){this._mo_box=this._ts_touch;for(var t,i=0,e=0,n=this.first(!0);t=n;){n=t.next(!0),t.matrix(!0);var r=t.pin("boxWidth"),s=t.pin("boxHeight");i=Math.max(i,r),e=Math.max(e,s)}i+=2*this._padding,e+=2*this._padding,this.pin("width")!=i&&this.pin("width",i),this.pin("height")!=e&&this.pin("height",e)}}),this},i.layer=function(){return i.create().layer().label("Layer")},i.prototype.layer=function(){return this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){var t=this.parent();if(t){var i=t.pin("width");this.pin("width")!=i&&this.pin("width",i);var e=t.pin("height");this.pin("height")!=e&&this.pin("height",e)}},!0),this},i.prototype.padding=function(t){return this._padding=t,this},i.prototype.spacing=function(t){return this._spacing=t,this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22}],13:[function(t){function i(t,i){function e(){o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,a,u),d.render(o)}function r(){h?(a=window.innerWidth>0?window.innerWidth:screen.width,u=window.innerHeight>0?window.innerHeight:screen.height,s.style.width=a+"px",s.style.height=u+"px"):(a=s.clientWidth,u=s.clientHeight),a*=f,u*=f,(s.width!==a||s.height!==u)&&(s.width=a,s.height=u,DEBUG&&console.log("Resize: "+a+" x "+u+" / "+f),d.viewport(a,u,f),e())}i=i||{};var s=i.canvas,o=null,h=!1,a=0,u=0,f=1;if("string"==typeof s&&(s=document.getElementById(s)),s||(s=document.getElementById("cutjs")||document.getElementById("stage")),!s){h=!0,DEBUG&&console.log("Creating Canvas..."),s=document.createElement("canvas"),s.style.position="absolute";var c=document.body;c.insertBefore(s,c.firstChild)}o=s.getContext("2d");var p=window.devicePixelRatio||1,l=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;f=p/l;var _=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)};DEBUG&&console.log("Creating stage...");var d=n.root(_,e);d.background=function(t){return s.style.backgroundColor=t,this},t(d,s),r(),window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1)}function e(t,i,e){DEBUG&&console.log("Loading image: "+t);var n=new Image;n.onload=function(){i(n)},n.onerror=e,n.src=t}"undefined"==typeof DEBUG&&(DEBUG=!0);var n=t("../core");window.addEventListener("load",function(){DEBUG&&console.log("On load."),n.start()},!1),n.config({"app-loader":i,"image-loader":e})},{"../core":8}],14:[function(t){var i=t("./core");t("./pin");var e=t("./util/stats");i.prototype._textures=null,i.prototype._alpha=1,i.prototype.render=function(t){if(this._visible){e.node++;var i=this.matrix();t.setTransform(i.a,i.b,i.c,i.d,i.e,i.f),this._alpha=this._pin._alpha*(this._parent?this._parent._alpha:1);var n=this._pin._textureAlpha*this._alpha;if(t.globalAlpha!=n&&(t.globalAlpha=n),null!==this._textures)for(var r=0,s=this._textures.length;s>r;r++)this._textures[r].draw(t);t.globalAlpha!=this._alpha&&(t.globalAlpha=this._alpha);for(var o,h=this._first;o=h;)h=o._next,o.render(t)}},i.prototype._tickBefore=null,i.prototype._tickAfter=null,i.prototype.MAX_ELAPSE=1/0,i.prototype._tick=function(t,i,n){if(this._visible){t>this.MAX_ELAPSE&&(t=this.MAX_ELAPSE);var r=!1;if(null!==this._tickBefore)for(var s=0,o=this._tickBefore.length;o>s;s++)e.tick++,r=this._tickBefore[s].call(this,t,i,n)===!0||r;for(var h,a=this._first;h=a;)a=h._next,h._flag("_tick")&&(r=h._tick(t,i,n)===!0?!0:r);if(null!==this._tickAfter)for(var s=0,o=this._tickAfter.length;o>s;s++)e.tick++,r=this._tickAfter[s].call(this,t,i,n)===!0||r;return r}},i.prototype.tick=function(t,i){"function"==typeof t&&(i?(null===this._tickBefore&&(this._tickBefore=[]),this._tickBefore.push(t)):(null===this._tickAfter&&(this._tickAfter=[]),this._tickAfter.push(t)),this._flag("_tick",null!==this._tickAfter&&this._tickAfter.length>0||null!==this._tickBefore&&this._tickBefore.length>0))},i.prototype.untick=function(t){if("function"==typeof t){var i;null!==this._tickBefore&&(i=this._tickBefore.indexOf(t))>=0&&this._tickBefore.splice(i,1),null!==this._tickAfter&&(i=this._tickAfter.indexOf(t))>=0&&this._tickAfter.splice(i,1)}},i.prototype.timeout=function(t,i){this.tick(function e(n){return(i-=n)<0?(this.untick(e),void t.call(this)):!0})}},{"./core":8,"./pin":16,"./util/stats":28}],15:[function(t,i){function e(t,i,e,n,r,s){this.reset(t,i,e,n,r,s)}e.prototype.toString=function(){return"["+this.a+", "+this.b+", "+this.c+", "+this.d+", "+this.e+", "+this.f+"]"},e.prototype.clone=function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)},e.prototype.reset=function(t,i,e,n,r,s){return this._dirty=!0,"object"==typeof t?(this.a=t.a,this.d=t.d,this.b=t.b,this.c=t.c,this.e=t.e,this.f=t.f):(this.a=t||1,this.d=n||1,this.b=i||0,this.c=e||0,this.e=r||0,this.f=s||0),this},e.prototype.identity=function(){return this._dirty=!0,this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this},e.prototype.rotate=function(t){if(!t)return this;this._dirty=!0;var i=t?Math.cos(t):1,e=t?Math.sin(t):0,n=i*this.a-e*this.b,r=i*this.b+e*this.a,s=i*this.c-e*this.d,o=i*this.d+e*this.c,h=i*this.e-e*this.f,a=i*this.f+e*this.e;return this.a=n,this.b=r,this.c=s,this.d=o,this.e=h,this.f=a,this},e.prototype.translate=function(t,i){return t||i?(this._dirty=!0,this.e+=t,this.f+=i,this):this},e.prototype.scale=function(t,i){return t-1||i-1?(this._dirty=!0,this.a*=t,this.b*=i,this.c*=t,this.d*=i,this.e*=t,this.f*=i,this):this},e.prototype.skew=function(t,i){if(!t&&!i)return this;this._dirty=!0;var e=this.a+this.b*t,n=this.b+this.a*i,r=this.c+this.d*t,s=this.d+this.c*i,o=this.e+this.f*t,h=this.f+this.e*i;return this.a=e,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},e.prototype.concat=function(t){this._dirty=!0;var i=this,e=i.a*t.a+i.b*t.c,n=i.b*t.d+i.a*t.b,r=i.c*t.a+i.d*t.c,s=i.d*t.d+i.c*t.b,o=i.e*t.a+t.e+i.f*t.c,h=i.f*t.d+t.f+i.e*t.b;return this.a=e,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},e.prototype.inverse=e.prototype.reverse=function(){if(this._dirty){this._dirty=!1,this.inversed=this.inversed||new e;var t=this.a*this.d-this.b*this.c;this.inversed.a=this.d/t,this.inversed.b=-this.b/t,this.inversed.c=-this.c/t,this.inversed.d=this.a/t,this.inversed.e=(this.c*this.f-this.e*this.d)/t,this.inversed.f=(this.e*this.b-this.a*this.f)/t}return this.inversed},e.prototype.map=function(t,i){return i=i||{},i.x=this.a*t.x+this.c*t.y+this.e,i.y=this.b*t.x+this.d*t.y+this.f,i},e.prototype.mapX=function(t,i){return"object"==typeof t&&(i=t.y,t=t.x),this.a*t+this.c*i+this.e},e.prototype.mapY=function(t,i){return"object"==typeof t&&(i=t.y,t=t.x),this.b*t+this.d*i+this.f},i.exports=e},{}],16:[function(t,i){function e(t){this._owner=t,this._parent=null,this._relativeMatrix=new s,this._absoluteMatrix=new s,this.reset()}function n(t,i,e,n){var r="number"==typeof i,s="number"==typeof e,h="string"==typeof n;t._ts_transform=++o,r&&(t._scaleX=i/t._width_,t._width=t._width_),s&&(t._scaleY=e/t._height_,t._height=t._height_),r&&s&&h&&("out"==n||"out-crop"==n?t._scaleX=t._scaleY=Math.max(t._scaleX,t._scaleY):("in"==n||"in-pad"==n)&&(t._scaleX=t._scaleY=Math.min(t._scaleX,t._scaleY)),("out-crop"==n||"in-pad"==n)&&(t._width=i/t._scaleX,t._height=e/t._scaleY))}var r=t("./core"),s=t("./matrix"),o=0;r._init(function(){this._pin=new e(this)}),r.prototype.matrix=function(t){return t===!0?this._pin.relativeMatrix():this._pin.absoluteMatrix()},r.prototype.pin=function(t,i){return"object"==typeof t?(this._pin.set(t),this):"string"==typeof t?"undefined"==typeof i?this._pin.get(t):(this._pin.set(t,i),this):"undefined"==typeof t?this._pin:void 0},e.prototype.reset=function(){this._textureAlpha=1,this._alpha=1,this._width=0,this._height=0,this._scaleX=1,this._scaleY=1,this._skewX=0,this._skewY=0,this._rotation=0,this._pivoted=!1,this._pivotX=null,this._pivotY=null,this._handled=!1,this._handleX=0,this._handleY=0,this._aligned=!1,this._alignX=0,this._alignY=0,this._offsetX=0,this._offsetY=0,this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height,this._ts_translate=++o,this._ts_transform=++o,this._ts_matrix=++o},e.prototype._update=function(){return this._parent=this._owner._parent&&this._owner._parent._pin,this._handled&&this._mo_handle!=this._ts_transform&&(this._mo_handle=this._ts_transform,this._ts_translate=++o),this._aligned&&this._parent&&this._mo_align!=this._parent._ts_transform&&(this._mo_align=this._parent._ts_transform,this._ts_translate=++o),this},e.prototype.toString=function(){return this._owner+" ("+(this._parent?this._parent._owner:null)+")"},e.prototype.absoluteMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_matrix:0);if(this._mo_abs==t)return this._absoluteMatrix;this._mo_abs=t;var i=this._absoluteMatrix;return i.reset(this.relativeMatrix()),this._parent&&i.concat(this._parent._absoluteMatrix),this._ts_matrix=++o,i},e.prototype.relativeMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_transform:0);if(this._mo_rel==t)return this._relativeMatrix;this._mo_rel=t;var i=this._relativeMatrix;if(i.identity(),this._pivoted&&i.translate(-this._pivotX*this._width,-this._pivotY*this._height),i.scale(this._scaleX,this._scaleY),i.skew(this._skewX,this._skewY),i.rotate(this._rotation),this._pivoted&&i.translate(this._pivotX*this._width,this._pivotY*this._height),this._pivoted)this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height;else{var e,n;i.a>0&&i.c>0||i.a<0&&i.c<0?(e=0,n=i.a*this._width+i.c*this._height):(e=i.a*this._width,n=i.c*this._height),e>n?(this._boxX=n,this._boxWidth=e-n):(this._boxX=e,this._boxWidth=n-e),i.b>0&&i.d>0||i.b<0&&i.d<0?(e=0,n=i.b*this._width+i.d*this._height):(e=i.b*this._width,n=i.d*this._height),e>n?(this._boxY=n,this._boxHeight=e-n):(this._boxY=e,this._boxHeight=n-e)}return this._x=this._offsetX,this._y=this._offsetY,this._x-=this._boxX+this._handleX*this._boxWidth,this._y-=this._boxY+this._handleY*this._boxHeight,this._aligned&&this._parent&&(this._parent.relativeMatrix(),this._x+=this._alignX*this._parent._width,this._y+=this._alignY*this._parent._height),i.translate(this._x,this._y),this._relativeMatrix},e.prototype.get=function(t){return"function"==typeof h[t]?h[t](this):void 0},e.prototype.set=function(t,i){if("string"==typeof t)"function"==typeof a[t]&&"undefined"!=typeof i&&a[t](this,i);else if("object"==typeof t)for(i in t)"function"==typeof a[i]&&"undefined"!=typeof t[i]&&a[i](this,t[i],t);return this._owner&&(this._owner._ts_pin=++o,this._owner.touch()),this};var h={alpha:function(t){return t._alpha},textureAlpha:function(t){return t._textureAlpha},width:function(t){return t._width},height:function(t){return t._height},boxWidth:function(t){return t._boxWidth},boxHeight:function(t){return t._boxHeight},scaleX:function(t){return t._scaleX},scaleY:function(t){return t._scaleY},skewX:function(t){return t._skewX},skewY:function(t){return t._skewY},rotation:function(t){return t._rotation},pivotX:function(t){return t._pivotX},pivotY:function(t){return t._pivotY},offsetX:function(t){return t._offsetX},offsetY:function(t){return t._offsetY},alignX:function(t){return t._alignX},alignY:function(t){return t._alignY},handleX:function(t){return t._handleX},handleY:function(t){return t._handleY}},a={alpha:function(t,i){t._alpha=i},textureAlpha:function(t,i){t._textureAlpha=i},width:function(t,i){t._width_=i,t._width=i,t._ts_transform=++o},height:function(t,i){t._height_=i,t._height=i,t._ts_transform=++o},scale:function(t,i){t._scaleX=i,t._scaleY=i,t._ts_transform=++o},scaleX:function(t,i){t._scaleX=i,t._ts_transform=++o},scaleY:function(t,i){t._scaleY=i,t._ts_transform=++o},skew:function(t,i){t._skewX=i,t._skewY=i,t._ts_transform=++o},skewX:function(t,i){t._skewX=i,t._ts_transform=++o},skewY:function(t,i){t._skewY=i,t._ts_transform=++o},rotation:function(t,i){t._rotation=i,t._ts_transform=++o},pivot:function(t,i){t._pivotX=i,t._pivotY=i,t._pivoted=!0,t._ts_transform=++o},pivotX:function(t,i){t._pivotX=i,t._pivoted=!0,t._ts_transform=++o},pivotY:function(t,i){t._pivotY=i,t._pivoted=!0,t._ts_transform=++o},offset:function(t,i){t._offsetX=i,t._offsetY=i,t._ts_translate=++o},offsetX:function(t,i){t._offsetX=i,t._ts_translate=++o},offsetY:function(t,i){t._offsetY=i,t._ts_translate=++o},align:function(t,i){this.alignX(t,i),this.alignY(t,i)},alignX:function(t,i){t._alignX=i,t._aligned=!0,t._ts_translate=++o,this.handleX(t,i)},alignY:function(t,i){t._alignY=i,t._aligned=!0,t._ts_translate=++o,this.handleY(t,i)},handle:function(t,i){this.handleX(t,i),this.handleY(t,i)},handleX:function(t,i){t._handleX=i,t._handled=!0,t._ts_translate=++o},handleY:function(t,i){t._handleY=i,t._handled=!0,t._ts_translate=++o},resizeMode:function(t,i,e){e&&("in"==i?i="in-pad":"out"==i&&(i="out-crop"),n(t,e.resizeWidth,e.resizeHeight,i))},resizeWidth:function(t,i,e){e&&e.resizeMode||n(t,i,null)},resizeHeight:function(t,i,e){e&&e.resizeMode||n(t,null,i)},scaleMode:function(t,i,e){e&&n(t,e.scaleWidth,e.scaleHeight,i)},scaleWidth:function(t,i,e){e&&e.scaleMode||n(t,i,null)},scaleHeight:function(t,i,e){e&&e.scaleMode||n(t,null,i)},matrix:function(t,i){this.scaleX(t,i.a),this.skewX(t,i.c/i.d),this.skewY(t,i.b/i.a),this.scaleY(t,i.d),this.offsetX(t,i.e),this.offsetY(t,i.f),this.rotation(t,0) | ||
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:"undefined"!=typeof global?i=global:"undefined"!=typeof self&&(i=self),i.Stage=t()}}(function(){return function t(i,e,n){function r(o,h){if(!e[o]){if(!i[o]){var a="function"==typeof require&&require;if(!h&&a)return a(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=e[o]={exports:{}};i[o][0].call(f.exports,function(t){var e=i[o][1][t];return r(e?e:t)},f,f.exports,t,i,e,n)}return e[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,i){i.exports=t("../lib/"),t("../lib/canvas"),t("../lib/image"),t("../lib/anim"),t("../lib/str"),t("../lib/layout"),t("../lib/addon/tween"),i.exports.Mouse=t("../lib/addon/mouse"),i.exports.Math=t("../lib/util/math"),i.exports._extend=t("../lib/util/extend"),i.exports._create=t("../lib/util/create"),t("../lib/loader/web")},{"../lib/":11,"../lib/addon/mouse":3,"../lib/addon/tween":4,"../lib/anim":5,"../lib/canvas":7,"../lib/image":10,"../lib/layout":12,"../lib/loader/web":13,"../lib/str":18,"../lib/util/create":22,"../lib/util/extend":24,"../lib/util/math":26}],2:[function(t,i){function e(t){return t}function n(t){if("function"==typeof t)return t;if("string"!=typeof t)return e;var i=r[t];if(i)return i;var n=/^(\w+)(-(in|out|in-out|out-in))?(\((.*)\))?$/i.exec(t);if(!n||!n.length)return e;var h=o[n[1]],a=s[n[3]],u=n[5];return i=h&&h.fn?h.fn:h&&h.fc?h.fc.apply(h.fc,u&&u.replace(/\s+/,"").split(",")):e,a&&(i=a.fn(i)),r[t]=i,i}var r={},s={},o={};n.add=function(t){for(var i=(t.name||t.mode).split(/\s+/),e=0;e<i.length;e++){var n=i[e];n&&((t.name?o:s)[n]=t)}},n.add({mode:"in",fn:function(t){return t}}),n.add({mode:"out",fn:function(t){return function(i){return 1-t(1-i)}}}),n.add({mode:"in-out",fn:function(t){return function(i){return.5>i?t(2*i)/2:1-t(2*(1-i))/2}}}),n.add({mode:"out-in",fn:function(t){return function(i){return.5>i?1-t(2*(1-i))/2:t(2*i)/2}}}),n.add({name:"linear",fn:function(t){return t}}),n.add({name:"quad",fn:function(t){return t*t}}),n.add({name:"cubic",fn:function(t){return t*t*t}}),n.add({name:"quart",fn:function(t){return t*t*t*t}}),n.add({name:"quint",fn:function(t){return t*t*t*t*t}}),n.add({name:"sin sine",fn:function(t){return 1-Math.cos(t*Math.PI/2)}}),n.add({name:"exp expo",fn:function(t){return 0==t?0:Math.pow(2,10*(t-1))}}),n.add({name:"circle circ",fn:function(t){return 1-Math.sqrt(1-t*t)}}),n.add({name:"bounce",fn:function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}}),n.add({name:"poly",fc:function(t){return function(i){return Math.pow(i,t)}}}),n.add({name:"elastic",fc:function(t,i){i=i||.45,t=t||1;var e=i/(2*Math.PI)*Math.asin(1/t);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin(2*(n-e)*Math.PI/i)}}}),n.add({name:"back",fc:function(t){return t="undefined"!=typeof t?t:1.70158,function(i){return i*i*((t+1)*i-t)}}}),i.exports=n},{}],3:[function(t,i){function e(t,i){if(this instanceof e){var n=t.viewport().ratio||1;t.on("viewport",function(t){n=t.ratio||n}),this.x=0,this.y=0,this.toString=function(){return(0|this.x)+"x"+(0|this.y)},this.locate=function(t){r(i,t,this),this.x*=n,this.y*=n},this.lookup=function(i,e){this.type=i,this.root=t,this.event=null,e.length=0,this.collect=e,this.root.visit(this.visitor,this)},this.publish=function(i,e,n){if(this.type=i,this.root=t,this.event=e,this.collect=!1,this.timeStamp=Date.now(),"mousemove"!==i&&"touchmove"!==i&&DEBUG&&console.log(this.type+" "+this),n){for(;n.length&&!this.visitor.end(n.shift(),this););n.length=0}else this.root.visit(this.visitor,this)},this.visitor={reverse:!0,visible:!0,start:function(t,i){return!t._flag(i.type)},end:function(t,i){s.raw=i.event,s.type=i.type,s.timeStamp=i.timeStamp,s.abs.x=i.x,s.abs.y=i.y;var e=t.listeners(i.type);if(e&&(t.matrix().inverse().map(i,s),(t===i.root||t.hitTest(s))&&(i.collect&&i.collect.push(t),i.event))){for(var n=!1,r=0;r<e.length;r++)n=e[r].call(t,s)?!0:n;return n}}}}}function n(t,i,e){Object.defineProperty(t,i,{value:e})}function r(t,i,e){i.touches&&i.touches.length?(e.x=i.touches[0].clientX,e.y=i.touches[0].clientY):(e.x=i.clientX,e.y=i.clientY);var n=t.getBoundingClientRect();return e.x-=n.left,e.y-=n.top,e.x-=0|t.clientLeft,e.y-=0|t.clientTop,e}"undefined"==typeof DEBUG&&(DEBUG=!0),t("../core")._load(function(t,i){e.subscribe(t,i)}),e.CLICK="click",e.START="touchstart mousedown",e.MOVE="touchmove mousemove",e.END="touchend mouseup",e.CANCEL="touchcancel mousecancel",e.subscribe=function(t,i){function n(i){i.preventDefault(),t.mouse.locate(i),t.mouse.publish(i.type,i),t.mouse.lookup("click",h),t.mouse.lookup("mousecancel",a)}function r(i){i.preventDefault(),t.mouse.locate(i),t.mouse.publish(i.type,i)}function s(i){i.preventDefault(),t.mouse.publish(i.type,i),h.length&&t.mouse.publish("click",i,h),a.length=0}function o(i){a.length&&t.mouse.publish("mousecancel",i,a),h.length=0}if(!t.mouse){t.mouse=new e(t,i),i.addEventListener("touchstart",n),i.addEventListener("touchend",s),i.addEventListener("touchmove",r),i.addEventListener("touchcancel",o),i.addEventListener("mousedown",n),i.addEventListener("mouseup",s),i.addEventListener("mousemove",r),document.addEventListener("mouseup",o),window.addEventListener("blur",o);var h=[],a=[]}};var s={},o={};n(s,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(s,"toString",function(){return(0|this.x)+"x"+(0|this.y)+" ("+this.abs+")"}),n(s,"abs",o),n(o,"clone",function(t){return t=t||{},t.x=this.x,t.y=this.y,t}),n(o,"toString",function(){return(0|this.x)+"x"+(0|this.y)}),i.exports=e},{"../core":8}],4:[function(t,i){function e(t,i,e){this._end={},this._duration=i||400,this._delay=e||0,this._owner=t,this._time=0}function n(t,i,e,n){"number"==typeof t.pin(e)?i[e]=n:"number"==typeof t.pin(e+"X")&&"number"==typeof t.pin(e+"Y")&&(i[e+"X"]=n,i[e+"Y"]=n)}var r=t("./easing"),s=t("../core"),o=t("../pin");s.prototype.tween=function(t,i,n){if("number"!=typeof t?(n=t,i=0,t=0):"number"!=typeof i&&(n=i,i=0),!this._tweens){this._tweens=[];var r=0;this.tick(function(t,i,e){if(this._tweens.length){var n=r!=e;if(r=i,n)return!0;var s=this._tweens[0].tick(this,t,i,e);return s&&this._tweens.shift(),"object"==typeof s&&this._tweens.unshift(s),!0}},!0)}this.touch(),n||(this._tweens.length=0);var s=new e(this,t,i);return this._tweens.push(s),s},e.prototype.tick=function(t,i){if(this._time+=i,!(this._time<this._delay)){var e=this._time-this._delay;if(!this._start){this._start={};for(var n in this._end)this._start[n]=this._owner.pin(n)}var r,s;e<this._duration?(r=e/this._duration,s=!1):(r=1,s=!0),r="function"==typeof this._easing?this._easing(r):r;var o=1-r;for(var n in this._end)this._owner.pin(n,this._start[n]*o+this._end[n]*r);if(s){try{this._done&&this._done.call(this._owner)}catch(h){console.log(h)}return this._next||!0}}},e.prototype.tween=function(t,i){return this._next=new e(this._owner,t,i)},e.prototype.duration=function(t){return this._duration=t,this},e.prototype.delay=function(t){return this._delay=t,this},e.prototype.ease=function(t){return this._easing=r(t),this},e.prototype.done=function(t){return this._done=t,this},e.prototype.hide=function(){return this.done(function(){this.hide()}),this},e.prototype.remove=function(){return this.done(function(){this.remove()}),this},e.prototype.pin=function(t,i){if("object"==typeof t)for(var e in t)n(this._owner,this._end,e,t[e]);else"undefined"!=typeof i&&n(this._owner,this._end,t,i);return this},o._add_shortcuts(e),e.prototype.then=function(t){return this.done(t),this},e.prototype.then=function(t){return this.done(t),this},e.prototype.clear=function(){return this},i.exports=e},{"../core":8,"../pin":16,"./easing":2}],5:[function(t){function i(){i._super.call(this),this.label("Anim"),this._textures=[],this._fps=e.Anim.FPS,this._ft=1e3/this._fps,this._time=-1,this._repeat=0,this._index=0,this._frames=[];var t=0;this.tick(function(i,e,n){if(!(this._time<0||this._frames.length<=1)){var r=t!=n;if(t=e,r)return!0;if(this._time+=i,this._time<this._ft)return!0;var s=this._time/this._ft|0;return this._time-=s*this._ft,this.moveFrame(s),this._repeat>0&&(this._repeat-=s)<=0?(this.stop(),this._callback&&this._callback(),!1):!0}},!1)}var e=t("./core");t("./pin"),t("./loop");var n=t("./util/create"),r=t("./util/math");e.anim=function(t,e){var n=new i;return n.frames(t).gotoFrame(0),e&&n.fps(e),n},i._super=e,i.prototype=n(i._super.prototype),e.Anim={FPS:15},i.prototype.fps=function(t){return"undefined"==typeof t?this._fps:(this._fps=t>0?t:e.Anim.FPS,this._ft=1e3/this._fps,this)},i.prototype.setFrames=function(t,i,e){return this.frames(t,i,e)},i.prototype.frames=function(t){return this._index=0,this._frames=e.texture(t).array(),this.touch(),this},i.prototype.length=function(){return this._frames?this._frames.length:0},i.prototype.gotoFrame=function(t,i){return this._index=0|r.rotate(t,this._frames.length),i=i||!this._textures[0],this._textures[0]=this._frames[this._index],i&&(this.pin("width",this._textures[0].width),this.pin("height",this._textures[0].height)),this.touch(),this},i.prototype.moveFrame=function(t){return this.gotoFrame(this._index+t)},i.prototype.repeat=function(t,i){return this._repeat=t*this._frames.length-1,this._callback=i,this.play(),this},i.prototype.play=function(t){return"undefined"!=typeof t?(this.gotoFrame(t),this._time=0):this._time<0&&(this._time=0),this.touch(),this},i.prototype.stop=function(t){return this._time=-1,"undefined"!=typeof t&&this.gotoFrame(t),this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/math":26}],6:[function(t,i){function e(t){function i(t){if(!t||u.fn(t.draw))return t;t=h({},t),u.fn(a)&&(t=a(t)),1!=c&&(t.x*=c,t.y*=c,t.width*=c,t.height*=c,t.top*=c,t.bottom*=c,t.left*=c,t.right*=c),0!=p&&(t.x+=p,t.y+=p,t.width-=2*p,t.height-=2*p,t.top-=p,t.bottom-=p,t.left-=p,t.right-=p);var i=o.pipe();return i.top=t.top,i.bottom=t.bottom,i.left=t.left,i.right=t.right,i.src(t.x,t.y,t.width,t.height),i}function s(t){if(l){if(u.fn(l))return l(t);if(u.hash(l))return l[t]}if(d){for(var i=null,e=0,n=0;n<d.length;n++)f.startsWith(d[n].name,t)&&(0===e?i=d[n]:1===e?i=[i,d[n]]:i.push(d[n]),e++);return 0===e&&u.fn(_)&&(i=function(i){return _(t+(i?i:""))}),i}}e._super.call(this);var o=this;r(t,"filter"),r(t,"cutouts"),r(t,"sprites"),r(t,"factory");var a=t.map||t.filter,c=t.ppu||t.ratio||1,p=t.trim||0,l=t.textures,_=t.factory,d=t.cutouts||t.sprites;this.select=function(t){if(!t)return new n(this.pipe());var e=s(t);return e?new n(e,s,i):void 0}}function n(t,i,e){function n(t,r){return t?u.fn(t.draw)?t:u.hash(t)&&u.number(t.width)&&u.number(t.height)&&u.fn(e)?e(t):u.hash(t)&&u.defined(r)?n(t[r]):u.fn(t)?n(t(r)):u.array(t)?n(t[0]):u.string(t)&&u.fn(i)?n(i(t)):void 0:l}this.one=function(i){return n(t,i)},this.array=function(i){var e=u.array(i)?i:[];if(u.array(t))for(var r=0;r<t.length;r++)e[r]=n(t[r]);else e[0]=n(t);return e}}function r(t,i,e){i in t&&console.log(e?e.replace("%name",i):"'"+i+"' field of texture atlas is deprecated.")}"undefined"==typeof DEBUG&&(DEBUG=!0);var s=t("./core"),o=t("./texture"),h=t("./util/extend"),a=t("./util/create"),u=t("./util/is"),f=t("./util/string"),c={},p=[];s.atlas=function(t){var i=u.fn(t.draw)?t:new e(t);t.name&&(c[t.name]=i),p.push(i),r(t,"imagePath"),r(t,"imageRatio");var n=t.imagePath,o=t.imageRatio||1;return u.string(t.image)?n=t.image:u.hash(t.image)&&(n=t.image.src||t.image.url,o=t.image.ratio||o),n&&s.preload(function(t){n=s.resolve(n),DEBUG&&console.log("Loading atlas: "+n);var e=s.config("image-loader");e(n,function(e){DEBUG&&console.log("Image loaded: "+n),i.src(e,o),t()},function(i){DEBUG&&console.log("Error loading atlas: "+n,i),t()})}),i},e._super=o,e.prototype=a(e._super.prototype);var l=new o;l.x=l.y=l.width=l.height=0,l.pipe=l.src=l.dest=function(){return this},l.draw=function(){};var _=new n(l);s.texture=function(t){if(!u.string(t))return new n(t);var i,e,r=null;for((e=t.indexOf(":"))>0&&t.length>e+1&&(i=c[t.slice(0,e)],r=i&&i.select(t.slice(e+1))),!r&&(i=c[t])&&(r=i.select()),e=0;!r&&e<p.length;e++)r=p[e].select(t);return r||(console.error("Texture not found: "+t),r=_),r},i.exports=e},{"./core":8,"./texture":19,"./util/create":22,"./util/extend":24,"./util/is":25,"./util/string":29}],7:[function(t){var i=t("./core"),e=t("./texture");i.canvas=function(t,i,n){"string"==typeof t?"object"==typeof i||("function"==typeof i&&(n=i),i={}):("function"==typeof t&&(n=t),i={},t="2d");var r=document.createElement("canvas"),s=r.getContext(t,i),o=new e(r);return o.context=function(){return s},o.size=function(t,i,e){return e=e||1,r.width=t*e,r.height=i*e,this.src(r,e),this},o.canvas=function(t){return"function"==typeof t?t.call(this,s):"undefined"==typeof t&&"function"==typeof n&&n.call(this,s),this},"function"==typeof n&&n.call(o,s),o}},{"./core":8,"./texture":19}],8:[function(t,i){function e(t){if(!(this instanceof e))return o.fn(t)?e.app.apply(e,arguments):o.object(t)?e.atlas.apply(e,arguments):t;r.create++;for(var i=0;i<a.length;i++)a[i].call(this)}function n(t,i){var e=document.createElement("script");e.addEventListener("load",function(){i()}),e.addEventListener("error",function(e){i(e||"Error loading script: "+t)}),e.src=t,e.id="preload-"+Date.now(),document.body.appendChild(e)}"undefined"==typeof DEBUG&&(DEBUG=!0);var r=t("./util/stats"),s=t("./util/extend"),o=t("./util/is"),h=t("./util/await");r.create=0;var a=[];e._init=function(t){a.push(t)};var u=[];e._load=function(t){u.push(t)};var f={};e.config=function(){return 1===arguments.length&&o.string(arguments[0])?f[arguments[0]]:(1===arguments.length&&o.object(arguments[0])&&s(f,arguments[0]),void(2===arguments.length&&o.string(arguments[0])&&f[(arguments[0],arguments[1])]))};var c=[],p=[],l=!1,_=!1;e.app=function(t,i){if(!l)return void c.push(arguments);DEBUG&&console.log("Creating app...");var n=e.config("app-loader");n(function(i,e){DEBUG&&console.log("Initing app...");for(var n=0;n<u.length;n++)u[n].call(this,i,e);t(i,e),p.push(i),DEBUG&&console.log("Starting app..."),i.start()},i)};var d=h();e.preload=function(t){if("string"==typeof t){var i=e.resolve(t);/\.js($|\?|\#)/.test(i)&&(DEBUG&&console.log("Loading script: "+i),t=function(t){n(i,t)})}"function"==typeof t&&t(d())},e.start=function(t){DEBUG&&console.log("Starting..."),e.config(t),d.then(function(){for(DEBUG&&console.log("Loading apps..."),l=!0;c.length;){var t=c.shift();e.app.apply(e,t)}})},e.pause=function(){if(!_){_=!0;for(var t=p.length-1;t>=0;t--)p[t].pause()}},e.resume=function(){if(_){_=!1;for(var t=p.length-1;t>=0;t--)p[t].resume()}},e.create=function(){return new e},e.resolve=function(){function t(){if(document.currentScript)return document.currentScript.src;var t;try{var e=new Error;if(!e.stack)throw e;t=e.stack}catch(e){t=e.stack}if("string"==typeof t){t=t.split("\n");for(var n=t.length;n--;){var r=t[n].match(/(\w+\:\/\/[^\/]*?\/.+?)(:\d+)(:\d+)?/);if(r)return r[1]}}if(i.length&&"readyState"in i[0])for(var n=i.length;n--;)if("interactive"===i[n].readyState)return i[n].src;return location.href}if("undefined"==typeof window||"undefined"==typeof document)return function(t){return t};var i=document.getElementsByTagName("script");return function(i){if(/^\.\//.test(i)){var e=t(),n=e.substring(0,e.lastIndexOf("/")+1);i=n+i.substring(2)}return i}}(),i.exports=e},{"./util/await":21,"./util/extend":24,"./util/is":25,"./util/stats":28}],9:[function(t){t("./util/event")(t("./core").prototype,function(t,i,e){t._flag(i,e)})},{"./core":8,"./util/event":23}],10:[function(t){function i(){i._super.call(this),this.label("Image"),this._textures=[],this._image=null}var e=t("./core");t("./pin"),t("./loop");var n=t("./util/repeat"),r=t("./util/create");e.image=function(t){var e=new i;return t&&e.image(t),e},i._super=e,i.prototype=r(i._super.prototype),i.prototype.setImage=function(t,i,e){return this.image(t,i,e)},i.prototype.image=function(t){return this._image=e.texture(t).one(),this.pin("width",this._image?this._image.width:0),this.pin("height",this._image?this._image.height:0),this._textures[0]=this._image.pipe(),this._textures.length=1,this},i.prototype.tile=function(t){return this._repeat(!1,t),this},i.prototype.stretch=function(t){return this._repeat(!0,t),this},i.prototype._repeat=function(t,i){function e(t,i,e,n,s,o,h,a,u){var f=r._textures.length>t?r._textures[t]:r._textures[t]=r._image.pipe();f.src(i,e,n,s),f.dest(o,h,a,u)}var r=this;this.untick(this._repeatTicker),this.tick(this._repeatTicker=function(){if(this._mo_stretch!=this._pin._ts_transform){this._mo_stretch=this._pin._ts_transform;var r=this.pin("width"),s=this.pin("height");this._textures.length=n(this._image,r,s,t,i,e)}})}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/repeat":27}],11:[function(t,i){i.exports=t("./core"),i.exports.Matrix=t("./matrix"),i.exports.Texture=t("./texture"),t("./atlas"),t("./tree"),t("./event"),t("./pin"),t("./loop"),t("./root")},{"./atlas":6,"./core":8,"./event":9,"./loop":14,"./matrix":15,"./pin":16,"./root":17,"./texture":19,"./tree":20}],12:[function(t){var i=t("./core");t("./pin"),t("./loop");t("./util/create");i.row=function(t){return i.create().row(t).label("Row")},i.prototype.row=function(t){return this.sequence("row",t),this},i.column=function(t){return i.create().column(t).label("Row")},i.prototype.column=function(t){return this.sequence("column",t),this},i.sequence=function(t,e){return i.create().sequence(t,e).label("Sequence")},i.prototype.sequence=function(t,i){return this._padding=this._padding||0,this._spacing=this._spacing||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_seq!=this._ts_touch){this._mo_seq=this._ts_touch;var e=this._mo_seqAlign!=this._ts_children;this._mo_seqAlign=this._ts_children;for(var n,r=0,s=0,o=this.first(!0),h=!0;n=o;){o=n.next(!0),n.matrix(!0);var a=n.pin("boxWidth"),u=n.pin("boxHeight");"column"==t?(!h&&(s+=this._spacing),n.pin("offsetY")!=s&&n.pin("offsetY",s),r=Math.max(r,a),s+=u,e&&n.pin("alignX",i)):"row"==t&&(!h&&(r+=this._spacing),n.pin("offsetX")!=r&&n.pin("offsetX",r),r+=a,s=Math.max(s,u),e&&n.pin("alignY",i)),h=!1}r+=2*this._padding,s+=2*this._padding,this.pin("width")!=r&&this.pin("width",r),this.pin("height")!=s&&this.pin("height",s)}}),this},i.box=function(){return i.create().box().label("Box")},i.prototype.box=function(){return this._padding=this._padding||0,this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){if(this._mo_box!=this._ts_touch){this._mo_box=this._ts_touch;for(var t,i=0,e=0,n=this.first(!0);t=n;){n=t.next(!0),t.matrix(!0);var r=t.pin("boxWidth"),s=t.pin("boxHeight");i=Math.max(i,r),e=Math.max(e,s)}i+=2*this._padding,e+=2*this._padding,this.pin("width")!=i&&this.pin("width",i),this.pin("height")!=e&&this.pin("height",e)}}),this},i.layer=function(){return i.create().layer().label("Layer")},i.prototype.layer=function(){return this.untick(this._layoutTiker),this.tick(this._layoutTiker=function(){var t=this.parent();if(t){var i=t.pin("width");this.pin("width")!=i&&this.pin("width",i);var e=t.pin("height");this.pin("height")!=e&&this.pin("height",e)}},!0),this},i.prototype.padding=function(t){return this._padding=t,this},i.prototype.spacing=function(t){return this._spacing=t,this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22}],13:[function(t){function i(t,i){function e(){o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,a,u),d.render(o)}function r(){h?(a=window.innerWidth>0?window.innerWidth:screen.width,u=window.innerHeight>0?window.innerHeight:screen.height,s.style.width=a+"px",s.style.height=u+"px"):(a=s.clientWidth,u=s.clientHeight),a*=f,u*=f,(s.width!==a||s.height!==u)&&(s.width=a,s.height=u,DEBUG&&console.log("Resize: "+a+" x "+u+" / "+f),d.viewport(a,u,f),e())}i=i||{};var s=i.canvas,o=null,h=!1,a=0,u=0,f=1;if("string"==typeof s&&(s=document.getElementById(s)),s||(s=document.getElementById("cutjs")||document.getElementById("stage")),!s){h=!0,DEBUG&&console.log("Creating Canvas..."),s=document.createElement("canvas"),s.style.position="absolute";var c=document.body;c.insertBefore(s,c.firstChild)}o=s.getContext("2d");var p=window.devicePixelRatio||1,l=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;f=p/l;var _=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)};DEBUG&&console.log("Creating stage...");var d=n.root(_,e);d.background=function(t){return s.style.backgroundColor=t,this},t(d,s),r(),window.addEventListener("resize",r,!1),window.addEventListener("orientationchange",r,!1)}function e(t,i,e){DEBUG&&console.log("Loading image: "+t);var n=new Image;n.onload=function(){i(n)},n.onerror=e,n.src=t}"undefined"==typeof DEBUG&&(DEBUG=!0);var n=t("../core");window.addEventListener("load",function(){DEBUG&&console.log("On load."),n.start()},!1),n.config({"app-loader":i,"image-loader":e})},{"../core":8}],14:[function(t){var i=t("./core");t("./pin");var e=t("./util/stats");i.prototype._textures=null,i.prototype._alpha=1,i.prototype.render=function(t){if(this._visible){e.node++;var i=this.matrix();t.setTransform(i.a,i.b,i.c,i.d,i.e,i.f),this._alpha=this._pin._alpha*(this._parent?this._parent._alpha:1);var n=this._pin._textureAlpha*this._alpha;if(t.globalAlpha!=n&&(t.globalAlpha=n),null!==this._textures)for(var r=0,s=this._textures.length;s>r;r++)this._textures[r].draw(t);t.globalAlpha!=this._alpha&&(t.globalAlpha=this._alpha);for(var o,h=this._first;o=h;)h=o._next,o.render(t)}},i.prototype._tickBefore=null,i.prototype._tickAfter=null,i.prototype.MAX_ELAPSE=1/0,i.prototype._tick=function(t,i,n){if(this._visible){t>this.MAX_ELAPSE&&(t=this.MAX_ELAPSE);var r=!1;if(null!==this._tickBefore)for(var s=0,o=this._tickBefore.length;o>s;s++)e.tick++,r=this._tickBefore[s].call(this,t,i,n)===!0||r;for(var h,a=this._first;h=a;)a=h._next,h._flag("_tick")&&(r=h._tick(t,i,n)===!0?!0:r);if(null!==this._tickAfter)for(var s=0,o=this._tickAfter.length;o>s;s++)e.tick++,r=this._tickAfter[s].call(this,t,i,n)===!0||r;return r}},i.prototype.tick=function(t,i){"function"==typeof t&&(i?(null===this._tickBefore&&(this._tickBefore=[]),this._tickBefore.push(t)):(null===this._tickAfter&&(this._tickAfter=[]),this._tickAfter.push(t)),this._flag("_tick",null!==this._tickAfter&&this._tickAfter.length>0||null!==this._tickBefore&&this._tickBefore.length>0))},i.prototype.untick=function(t){if("function"==typeof t){var i;null!==this._tickBefore&&(i=this._tickBefore.indexOf(t))>=0&&this._tickBefore.splice(i,1),null!==this._tickAfter&&(i=this._tickAfter.indexOf(t))>=0&&this._tickAfter.splice(i,1)}},i.prototype.timeout=function(t,i){this.tick(function e(n){return(i-=n)<0?(this.untick(e),void t.call(this)):!0})}},{"./core":8,"./pin":16,"./util/stats":28}],15:[function(t,i){function e(t,i,e,n,r,s){this.reset(t,i,e,n,r,s)}e.prototype.toString=function(){return"["+this.a+", "+this.b+", "+this.c+", "+this.d+", "+this.e+", "+this.f+"]"},e.prototype.clone=function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)},e.prototype.reset=function(t,i,e,n,r,s){return this._dirty=!0,"object"==typeof t?(this.a=t.a,this.d=t.d,this.b=t.b,this.c=t.c,this.e=t.e,this.f=t.f):(this.a=t||1,this.d=n||1,this.b=i||0,this.c=e||0,this.e=r||0,this.f=s||0),this},e.prototype.identity=function(){return this._dirty=!0,this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this},e.prototype.rotate=function(t){if(!t)return this;this._dirty=!0;var i=t?Math.cos(t):1,e=t?Math.sin(t):0,n=i*this.a-e*this.b,r=i*this.b+e*this.a,s=i*this.c-e*this.d,o=i*this.d+e*this.c,h=i*this.e-e*this.f,a=i*this.f+e*this.e;return this.a=n,this.b=r,this.c=s,this.d=o,this.e=h,this.f=a,this},e.prototype.translate=function(t,i){return t||i?(this._dirty=!0,this.e+=t,this.f+=i,this):this},e.prototype.scale=function(t,i){return t-1||i-1?(this._dirty=!0,this.a*=t,this.b*=i,this.c*=t,this.d*=i,this.e*=t,this.f*=i,this):this},e.prototype.skew=function(t,i){if(!t&&!i)return this;this._dirty=!0;var e=this.a+this.b*t,n=this.b+this.a*i,r=this.c+this.d*t,s=this.d+this.c*i,o=this.e+this.f*t,h=this.f+this.e*i;return this.a=e,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},e.prototype.concat=function(t){this._dirty=!0;var i=this,e=i.a*t.a+i.b*t.c,n=i.b*t.d+i.a*t.b,r=i.c*t.a+i.d*t.c,s=i.d*t.d+i.c*t.b,o=i.e*t.a+t.e+i.f*t.c,h=i.f*t.d+t.f+i.e*t.b;return this.a=e,this.b=n,this.c=r,this.d=s,this.e=o,this.f=h,this},e.prototype.inverse=e.prototype.reverse=function(){if(this._dirty){this._dirty=!1,this.inversed=this.inversed||new e;var t=this.a*this.d-this.b*this.c;this.inversed.a=this.d/t,this.inversed.b=-this.b/t,this.inversed.c=-this.c/t,this.inversed.d=this.a/t,this.inversed.e=(this.c*this.f-this.e*this.d)/t,this.inversed.f=(this.e*this.b-this.a*this.f)/t}return this.inversed},e.prototype.map=function(t,i){return i=i||{},i.x=this.a*t.x+this.c*t.y+this.e,i.y=this.b*t.x+this.d*t.y+this.f,i},e.prototype.mapX=function(t,i){return"object"==typeof t&&(i=t.y,t=t.x),this.a*t+this.c*i+this.e},e.prototype.mapY=function(t,i){return"object"==typeof t&&(i=t.y,t=t.x),this.b*t+this.d*i+this.f},i.exports=e},{}],16:[function(t,i){function e(t){this._owner=t,this._parent=null,this._relativeMatrix=new s,this._absoluteMatrix=new s,this.reset()}function n(t,i,e,n){var r="number"==typeof i,s="number"==typeof e,h="string"==typeof n;t._ts_transform=++o,r&&(t._scaleX=i/t._width_,t._width=t._width_),s&&(t._scaleY=e/t._height_,t._height=t._height_),r&&s&&h&&("out"==n||"out-crop"==n?t._scaleX=t._scaleY=Math.max(t._scaleX,t._scaleY):("in"==n||"in-pad"==n)&&(t._scaleX=t._scaleY=Math.min(t._scaleX,t._scaleY)),("out-crop"==n||"in-pad"==n)&&(t._width=i/t._scaleX,t._height=e/t._scaleY))}var r=t("./core"),s=t("./matrix"),o=0;r._init(function(){this._pin=new e(this)}),r.prototype.matrix=function(t){return t===!0?this._pin.relativeMatrix():this._pin.absoluteMatrix()},r.prototype.pin=function(t,i){return"object"==typeof t?(this._pin.set(t),this):"string"==typeof t?"undefined"==typeof i?this._pin.get(t):(this._pin.set(t,i),this):"undefined"==typeof t?this._pin:void 0},e.prototype.reset=function(){this._textureAlpha=1,this._alpha=1,this._width=0,this._height=0,this._scaleX=1,this._scaleY=1,this._skewX=0,this._skewY=0,this._rotation=0,this._pivoted=!1,this._pivotX=null,this._pivotY=null,this._handled=!1,this._handleX=0,this._handleY=0,this._aligned=!1,this._alignX=0,this._alignY=0,this._offsetX=0,this._offsetY=0,this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height,this._ts_translate=++o,this._ts_transform=++o,this._ts_matrix=++o},e.prototype._update=function(){return this._parent=this._owner._parent&&this._owner._parent._pin,this._handled&&this._mo_handle!=this._ts_transform&&(this._mo_handle=this._ts_transform,this._ts_translate=++o),this._aligned&&this._parent&&this._mo_align!=this._parent._ts_transform&&(this._mo_align=this._parent._ts_transform,this._ts_translate=++o),this},e.prototype.toString=function(){return this._owner+" ("+(this._parent?this._parent._owner:null)+")"},e.prototype.absoluteMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_matrix:0);if(this._mo_abs==t)return this._absoluteMatrix;this._mo_abs=t;var i=this._absoluteMatrix;return i.reset(this.relativeMatrix()),this._parent&&i.concat(this._parent._absoluteMatrix),this._ts_matrix=++o,i},e.prototype.relativeMatrix=function(){this._update();var t=Math.max(this._ts_transform,this._ts_translate,this._parent?this._parent._ts_transform:0);if(this._mo_rel==t)return this._relativeMatrix;this._mo_rel=t;var i=this._relativeMatrix;if(i.identity(),this._pivoted&&i.translate(-this._pivotX*this._width,-this._pivotY*this._height),i.scale(this._scaleX,this._scaleY),i.skew(this._skewX,this._skewY),i.rotate(this._rotation),this._pivoted&&i.translate(this._pivotX*this._width,this._pivotY*this._height),this._pivoted)this._boxX=0,this._boxY=0,this._boxWidth=this._width,this._boxHeight=this._height;else{var e,n;i.a>0&&i.c>0||i.a<0&&i.c<0?(e=0,n=i.a*this._width+i.c*this._height):(e=i.a*this._width,n=i.c*this._height),e>n?(this._boxX=n,this._boxWidth=e-n):(this._boxX=e,this._boxWidth=n-e),i.b>0&&i.d>0||i.b<0&&i.d<0?(e=0,n=i.b*this._width+i.d*this._height):(e=i.b*this._width,n=i.d*this._height),e>n?(this._boxY=n,this._boxHeight=e-n):(this._boxY=e,this._boxHeight=n-e)}return this._x=this._offsetX,this._y=this._offsetY,this._x-=this._boxX+this._handleX*this._boxWidth,this._y-=this._boxY+this._handleY*this._boxHeight,this._aligned&&this._parent&&(this._parent.relativeMatrix(),this._x+=this._alignX*this._parent._width,this._y+=this._alignY*this._parent._height),i.translate(this._x,this._y),this._relativeMatrix},e.prototype.get=function(t){return"function"==typeof h[t]?h[t](this):void 0},e.prototype.set=function(t,i){if("string"==typeof t)"function"==typeof a[t]&&"undefined"!=typeof i&&a[t](this,i);else if("object"==typeof t)for(i in t)"function"==typeof a[i]&&"undefined"!=typeof t[i]&&a[i](this,t[i],t);return this._owner&&(this._owner._ts_pin=++o,this._owner.touch()),this};var h={alpha:function(t){return t._alpha},textureAlpha:function(t){return t._textureAlpha},width:function(t){return t._width},height:function(t){return t._height},boxWidth:function(t){return t._boxWidth},boxHeight:function(t){return t._boxHeight},scaleX:function(t){return t._scaleX},scaleY:function(t){return t._scaleY},skewX:function(t){return t._skewX},skewY:function(t){return t._skewY},rotation:function(t){return t._rotation},pivotX:function(t){return t._pivotX},pivotY:function(t){return t._pivotY},offsetX:function(t){return t._offsetX},offsetY:function(t){return t._offsetY},alignX:function(t){return t._alignX},alignY:function(t){return t._alignY},handleX:function(t){return t._handleX},handleY:function(t){return t._handleY}},a={alpha:function(t,i){t._alpha=i},textureAlpha:function(t,i){t._textureAlpha=i},width:function(t,i){t._width_=i,t._width=i,t._ts_transform=++o},height:function(t,i){t._height_=i,t._height=i,t._ts_transform=++o},scale:function(t,i){t._scaleX=i,t._scaleY=i,t._ts_transform=++o},scaleX:function(t,i){t._scaleX=i,t._ts_transform=++o},scaleY:function(t,i){t._scaleY=i,t._ts_transform=++o},skew:function(t,i){t._skewX=i,t._skewY=i,t._ts_transform=++o},skewX:function(t,i){t._skewX=i,t._ts_transform=++o},skewY:function(t,i){t._skewY=i,t._ts_transform=++o},rotation:function(t,i){t._rotation=i,t._ts_transform=++o},pivot:function(t,i){t._pivotX=i,t._pivotY=i,t._pivoted=!0,t._ts_transform=++o},pivotX:function(t,i){t._pivotX=i,t._pivoted=!0,t._ts_transform=++o},pivotY:function(t,i){t._pivotY=i,t._pivoted=!0,t._ts_transform=++o},offset:function(t,i){t._offsetX=i,t._offsetY=i,t._ts_translate=++o},offsetX:function(t,i){t._offsetX=i,t._ts_translate=++o},offsetY:function(t,i){t._offsetY=i,t._ts_translate=++o},align:function(t,i){this.alignX(t,i),this.alignY(t,i)},alignX:function(t,i){t._alignX=i,t._aligned=!0,t._ts_translate=++o,this.handleX(t,i)},alignY:function(t,i){t._alignY=i,t._aligned=!0,t._ts_translate=++o,this.handleY(t,i)},handle:function(t,i){this.handleX(t,i),this.handleY(t,i)},handleX:function(t,i){t._handleX=i,t._handled=!0,t._ts_translate=++o},handleY:function(t,i){t._handleY=i,t._handled=!0,t._ts_translate=++o},resizeMode:function(t,i,e){e&&("in"==i?i="in-pad":"out"==i&&(i="out-crop"),n(t,e.resizeWidth,e.resizeHeight,i))},resizeWidth:function(t,i,e){e&&e.resizeMode||n(t,i,null)},resizeHeight:function(t,i,e){e&&e.resizeMode||n(t,null,i)},scaleMode:function(t,i,e){e&&n(t,e.scaleWidth,e.scaleHeight,i)},scaleWidth:function(t,i,e){e&&e.scaleMode||n(t,i,null)},scaleHeight:function(t,i,e){e&&e.scaleMode||n(t,null,i)},matrix:function(t,i){this.scaleX(t,i.a),this.skewX(t,i.c/i.d),this.skewY(t,i.b/i.a),this.scaleY(t,i.d),this.offsetX(t,i.e),this.offsetY(t,i.f),this.rotation(t,0) | ||
}};r.prototype.scaleTo=function(t,i,e){return"object"==typeof t&&(e=i,i=t.y,t=t.x),n(this._pin,t,i,e),this},e._add_shortcuts=function(t){t.prototype.size=function(t,i){return this.pin("width",t),this.pin("height",i),this},t.prototype.width=function(t){return"undefined"==typeof t?this.pin("width"):(this.pin("width",t),this)},t.prototype.height=function(t){return"undefined"==typeof t?this.pin("height"):(this.pin("height",t),this)},t.prototype.offset=function(t,i){return"object"==typeof t&&(i=t.y,t=t.x),this.pin("offsetX",t),this.pin("offsetY",i),this},t.prototype.rotate=function(t){return this.pin("rotation",t),this},t.prototype.skew=function(t,i){return"object"==typeof t?(i=t.y,t=t.x):"undefined"==typeof i&&(i=t),this.pin("skewX",t),this.pin("skewY",i),this},t.prototype.scale=function(t,i){return"object"==typeof t?(i=t.y,t=t.x):"undefined"==typeof i&&(i=t),this.pin("scaleX",t),this.pin("scaleY",i),this},t.prototype.alpha=function(t,i){return this.pin("alpha",t),"undefined"!=typeof i&&this.pin("textureAlpha",i),this}},e._add_shortcuts(r),i.exports=e},{"./core":8,"./matrix":15}],17:[function(t){function i(t,e){i._super.call(this),this.label("Root");var r=!0,s=this,o=0,h=function(i){if(r!==!0){n.tick=n.node=n.draw=0;var a=o||i,u=i-a;o=i;var f=s._tick(u,i,a);s._mo_touch!=s._ts_touch?(s._mo_touch=s._ts_touch,e(s),t(h)):f?t(h):r=!0,n.fps=u?1e3/u:0}};this.start=function(){return this.resume()},this.resume=function(){return r&&(r=!1,t(h)),this},this.pause=function(){return r=!0,this},this.touch_root=this.touch,this.touch=function(){return this.resume(),this.touch_root()}}var e=t("./core");t("./pin"),t("./loop");var n=t("./util/stats"),r=t("./util/create"),s=t("./util/extend");i._super=e,i.prototype=r(i._super.prototype),e.root=function(t,e){return new i(t,e)},i.prototype.background=function(){return this},i.prototype.viewport=function(t,i,e){if("undefined"==typeof t)return s({},this._viewport);this._viewport={width:t,height:i,ratio:e||1},this.viewbox();var n=s({},this._viewport);return this.visit({start:function(t){return t._flag("viewport")?void t.publish("viewport",[n]):!0}}),this},i.prototype.viewbox=function(t,i,e){"number"==typeof t&&"number"==typeof i&&(this._viewbox={width:t,height:i,mode:/^(in|out|in-pad|out-crop)$/.test(e)?e:"in-pad"});var n=this._viewbox,r=this._viewport;return r&&n?(this.pin({width:n.width,height:n.height}),this.scaleTo(r.width,r.height,n.mode)):r&&this.pin({width:r.width,height:r.height}),this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/extend":24,"./util/stats":28}],18:[function(t){function i(){i._super.call(this),this.label("String"),this._textures=[]}var e=t("./core");t("./pin"),t("./loop");var n=t("./util/create"),r=t("./util/is");e.string=function(t){return(new i).frames(t)},i._super=e,i.prototype=n(i._super.prototype),i.prototype.setFont=function(t,i,e){return this.frames(t,i,e)},i.prototype.frames=function(t){return this._textures=[],"string"==typeof t?(t=e.texture(t),this._item=function(i){return t.one(i)}):"object"==typeof t?this._item=function(i){return t[i]}:"function"==typeof t&&(this._item=t),this},i.prototype.setValue=function(t,i,e){return this.value(t,i,e)},i.prototype.value=function(t){if("undefined"==typeof t)return this._value;if(this._value===t)return this;this._value=t,null===t?t="":"string"==typeof t||r.array(t)||(t=t.toString()),this._spacing=this._spacing||0;for(var i=0,e=0,n=0;n<t.length;n++){var s=this._textures[n]=this._item(t[n]);i+=n>0?this._spacing:0,s.dest(i,0),i+=s.width,e=Math.max(e,s.height)}return this.pin("width",i),this.pin("height",e),this._textures.length=t.length,this}},{"./core":8,"./loop":14,"./pin":16,"./util/create":22,"./util/is":25}],19:[function(t,i){function e(t,i){"object"==typeof t&&this.src(t,i)}var n=t("./util/stats"),r=t("./util/math");e.prototype.pipe=function(){return new e(this)},e.prototype.src=function(t,i,e,n){if("object"==typeof t){var r=t,s=i||1;this._image=r,this._sx=this._dx=0,this._sy=this._dy=0,this._sw=this._dw=r.width/s,this._sh=this._dh=r.height/s,this.width=r.width/s,this.height=r.height/s,this.ratio=s}else"undefined"==typeof e?(e=t,n=i):(this._sx=t,this._sy=i),this._sw=this._dw=e,this._sh=this._dh=n,this.width=e,this.height=n;return this},e.prototype.dest=function(t,i,e,n){return this._dx=t,this._dy=i,this._dx=t,this._dy=i,"undefined"!=typeof e&&(this._dw=e,this._dh=n,this.width=e,this.height=n),this},e.prototype.draw=function(t,i,e,s,o,h,a,u,f){var c=this._image;if(null!==c&&"object"==typeof c){var p=this._sx,l=this._sy,_=this._sw,d=this._sh,g=this._dx,y=this._dy,m=this._dw,v=this._dh;"undefined"!=typeof h?(i=r.limit(i,0,this._sw),s=r.limit(s,0,this._sw-i),e=r.limit(e,0,this._sh),o=r.limit(o,0,this._sh-e),p+=i,l+=e,_=s,d=o,g=h,y=a,m=u,v=f):"undefined"!=typeof s?(g=i,y=e,m=s,v=o):"undefined"!=typeof i&&(m=i,v=e);var x=this.ratio||1;p*=x,l*=x,_*=x,d*=x;try{"function"==typeof c.draw?c.draw(t,p,l,_,d,g,y,m,v):(n.draw++,t.drawImage(c,p,l,_,d,g,y,m,v))}catch(b){c._draw_failed||(console.log("Unable to draw: ",c),console.log(b),c._draw_failed=!0)}}},i.exports=e},{"./util/math":26,"./util/stats":28}],20:[function(t,i){function e(t,i){o(i),o(t),i.remove(),t._last&&(t._last._next=i,i._prev=t._last),i._parent=t,t._last=i,t._first||(t._first=i),i._parent._flag(i,!0),i._ts_parent=++u,t._ts_children=++u,t.touch()}function n(t,i){o(i),o(t),i.remove(),t._first&&(t._first._prev=i,i._next=t._first),i._parent=t,t._first=i,t._last||(t._last=i),i._parent._flag(i,!0),i._ts_parent=++u,t._ts_children=++u,t.touch()}function r(t,i){o(t),o(i),t.remove();var e=i._parent,n=i._prev;i._prev=t,n&&(n._next=t)||e&&(e._first=t),t._parent=e,t._prev=n,t._next=i,t._parent._flag(t,!0),t._ts_parent=++u,t.touch()}function s(t,i){o(t),o(i),t.remove();var e=i._parent,n=i._next;i._next=t,n&&(n._prev=t)||e&&(e._last=t),t._parent=e,t._prev=i,t._next=n,t._parent._flag(t,!0),t._ts_parent=++u,t.touch()}function o(t){if(t&&t instanceof h)return t;throw"Invalid node: "+t}var h=t("./core"),a=t("./util/is"),u=0;h.prototype._label="",h.prototype._visible=!0,h.prototype._parent=null,h.prototype._next=null,h.prototype._prev=null,h.prototype._first=null,h.prototype._last=null,h.prototype._attrs=null,h.prototype._flags=null,h.prototype.toString=function(){return"["+this._label+"]"},h.prototype.id=function(t){return this.label(t)},h.prototype.label=function(t){return"undefined"==typeof t?this._label:(this._label=t,this)},h.prototype.attr=function(t,i){return"undefined"==typeof i?null!==this._attrs?this._attrs[t]:void 0:((null!==this._attrs?this._attrs:this._attrs={})[t]=i,this)},h.prototype.visible=function(t){return"undefined"==typeof t?this._visible:(this._visible=t,this._parent&&(this._parent._ts_children=++u),this._ts_pin=++u,this.touch(),this)},h.prototype.hide=function(){return this.visible(!1)},h.prototype.show=function(){return this.visible(!0)},h.prototype.parent=function(){return this._parent},h.prototype.next=function(t){for(var i=this._next;i&&t&&!i._visible;)i=i._next;return i},h.prototype.prev=function(t){for(var i=this._prev;i&&t&&!i._visible;)i=i._prev;return i},h.prototype.first=function(t){for(var i=this._first;i&&t&&!i._visible;)i=i._next;return i},h.prototype.last=function(t){for(var i=this._last;i&&t&&!i._visible;)i=i._prev;return i},h.prototype.visit=function(t,i){var e=t.reverse,n=t.visible;if(!t.start||!t.start(this,i)){for(var r,s=e?this.last(n):this.first(n);r=s;)if(s=e?r.prev(n):r.next(n),r.visit(t,i))return!0;return t.end&&t.end(this,i)}},h.prototype.append=function(t,i){if(a.array(t))for(var n=0;n<t.length;n++)e(this,t[n]);else if("undefined"!=typeof i)for(var n=0;n<arguments.length;n++)e(this,arguments[n]);else"undefined"!=typeof t&&e(this,t);return this},h.prototype.prepend=function(t,i){if(a.array(t))for(var e=t.length-1;e>=0;e--)n(this,t[e]);else if("undefined"!=typeof i)for(var e=arguments.length-1;e>=0;e--)n(this,arguments[e]);else"undefined"!=typeof t&&n(this,t);return this},h.prototype.appendTo=function(t){return e(t,this),this},h.prototype.prependTo=function(t){return n(t,this),this},h.prototype.insertNext=function(t,i){if(a.array(t))for(var e=0;e<t.length;e++)s(t[e],this);else if("undefined"!=typeof i)for(var e=0;e<arguments.length;e++)s(arguments[e],this);else"undefined"!=typeof t&&s(t,this);return this},h.prototype.insertPrev=function(t,i){if(a.array(t))for(var e=t.length-1;e>=0;e--)r(t[e],this);else if("undefined"!=typeof i)for(var e=arguments.length-1;e>=0;e--)r(arguments[e],this);else"undefined"!=typeof t&&r(t,this);return this},h.prototype.insertAfter=function(t){return s(this,t),this},h.prototype.insertBefore=function(t){return r(this,t),this},h.prototype.remove=function(t,i){if("undefined"!=typeof t){if(a.array(t))for(var e=0;e<t.length;e++)o(t[e]).remove();else if("undefined"!=typeof i)for(var e=0;e<arguments.length;e++)o(arguments[e]).remove();else o(t).remove();return this}return this._prev&&(this._prev._next=this._next),this._next&&(this._next._prev=this._prev),this._parent&&(this._parent._first===this&&(this._parent._first=this._next),this._parent._last===this&&(this._parent._last=this._prev),this._parent._flag(this,!1),this._parent._ts_children=++u,this._parent.touch()),this._prev=this._next=this._parent=null,this._ts_parent=++u,this},h.prototype.empty=function(){for(var t,i=this._first;t=i;)i=t._next,t._prev=t._next=t._parent=null,this._flag(t,!1);return this._first=this._last=null,this._ts_children=++u,this.touch(),this},h.prototype.touch=function(){return this._ts_touch=++u,this._parent&&this._parent.touch(),this},h.prototype._flag=function(t,i){if("undefined"==typeof i)return null!==this._flags&&this._flags[t]||0;if("string"==typeof t&&(i?(this._flags=this._flags||{},!this._flags[t]&&this._parent&&this._parent._flag(t,!0),this._flags[t]=(this._flags[t]||0)+1):this._flags&&this._flags[t]>0&&(1==this._flags[t]&&this._parent&&this._parent._flag(t,!1),this._flags[t]=this._flags[t]-1)),"object"==typeof t&&t._flags)for(var e in t._flags)t._flags[e]>0&&this._flag(e,i);return this},h.prototype.hitTest=function(t){return this.attr("spy")?!0:t.x>=0&&t.x<=this._pin._width&&t.y>=0&&t.y<=this._pin._height},i.exports=h},{"./core":8,"./util/is":25}],21:[function(t,i){i.exports=function(){function t(t,n){return e+=n="number"==typeof n&&n>=1?n:1,function(){t&&t.apply(this,arguments),n>0&&(n--,e--,i())}}function i(){if(0===e)for(;n.length;)setTimeout(n.shift(),0)}var e=0,n=[];return t.then=function(t){0===e?setTimeout(t,0):n.push(t)},t}},{}],22:[function(t,i){function e(){}i.exports="function"==typeof Object.create?function(t,i){return Object.create.call(Object,t,i)}:function(t,i){if(i)throw Error("Second argument is not supported!");if("object"!=typeof t||null===t)throw Error("Invalid prototype!");return e.prototype=t,new e}},{}],23:[function(t,i){i.exports=function(t,i){t._listeners=null,t.on=t.listen=function(t,e){if(!t||!t.length||"function"!=typeof e)return this;null===this._listeners&&(this._listeners={});var n="string"!=typeof t&&"function"==typeof t.join;if(t=(n?t.join(" "):t).match(/\S+/g))for(var r=0;r<t.length;r++){var s=t[r];this._listeners[s]=this._listeners[s]||[],this._listeners[s].push(e),"function"==typeof i&&i(this,s,!0)}return this},t.off=function(t,e){if(!t||!t.length||"function"!=typeof e)return this;if(null===this._listeners)return this;var n="string"!=typeof t&&"function"==typeof t.join;if(t=(n?t.join(" "):t).match(/\S+/g))for(var r=0;r<t.length;r++){var s,o=t[r],h=this._listeners[o];h&&(s=h.indexOf(e))>=0&&(h.splice(s,1),h.length||delete this._listeners[o],"function"==typeof i&&i(this,o,!1))}return this},t.listeners=function(t){return this._listeners&&this._listeners[t]},t.publish=function(t,i){var e=this.listeners(t);if(!e||!e.length)return 0;for(var n=0;n<e.length;n++)e[n].apply(this,i);return e.length},t.trigger=function(t,i){return this.publish(t,i),this}}},{}],24:[function(t,i){i.exports=function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}return t}},{}],25:[function(t,i){var e=Object.prototype,n=e.hasOwnProperty,r=e.toString,s=/^[A-Fa-f0-9]+$/,o=i.exports={};o.a=o.an=o.type=function(t,i){return typeof t===i},o.defined=function(t){return"undefined"!=typeof t},o.empty=function(t){var i,e=r.call(t);if("[object Array]"===e||"[object Arguments]"===e||"[object String]"===e)return 0===t.length;if("[object Object]"===e){for(i in t)if(n.call(t,i))return!1;return!0}return!t},o.equal=function(t,i){if(t===i)return!0;var e,n=r.call(t);if(n!==r.call(i))return!1;if("[object Object]"===n){for(e in t)if(!(o.equal(t[e],i[e])&&e in i))return!1;for(e in i)if(!(o.equal(t[e],i[e])&&e in t))return!1;return!0}if("[object Array]"===n){if(e=t.length,e!==i.length)return!1;for(;--e;)if(!o.equal(t[e],i[e]))return!1;return!0}return"[object Function]"===n?t.prototype===i.prototype:"[object Date]"===n?t.getTime()===i.getTime():!1},o.instance=function(t,i){return t instanceof i},o.nil=function(t){return null===t},o.undef=function(t){return"undefined"==typeof t},o.array=function(t){return"[object Array]"===r.call(t)},o.emptyarray=function(t){return o.array(t)&&0===t.length},o.arraylike=function(t){return!!t&&!o["boolean"](t)&&n.call(t,"length")&&isFinite(t.length)&&o.number(t.length)&&t.length>=0},o["boolean"]=function(t){return"[object Boolean]"===r.call(t)},o.element=function(t){return void 0!==t&&"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&1===t.nodeType},o.fn=function(t){return"[object Function]"===r.call(t)},o.number=function(t){return"[object Number]"===r.call(t)},o.nan=function(t){return!o.number(t)||t!==t},o.object=function(t){return"[object Object]"===r.call(t)},o.hash=function(t){return o.object(t)&&t.constructor===Object&&!t.nodeType&&!t.setInterval},o.regexp=function(t){return"[object RegExp]"===r.call(t)},o.string=function(t){return"[object String]"===r.call(t)},o.hex=function(t){return o.string(t)&&(!t.length||s.test(t))}},{}],26:[function(t,i){var e=t("./create"),n=Math;i.exports=e(Math),i.exports.random=function(t,i){return"undefined"==typeof t?(i=1,t=0):"undefined"==typeof i&&(i=t,t=0),t==i?t:n.random()*(i-t)+t},i.exports.rotate=function(t,i,e){return"undefined"==typeof i?(e=1,i=0):"undefined"==typeof e&&(e=i,i=0),e>i?(t=(t-i)%(e-i),t+(0>t?e:i)):(t=(t-e)%(i-e),t+(0>=t?i:e))},i.exports.limit=function(t,i,e){return i>t?i:t>e?e:t},i.exports.length=function(t,i){return n.sqrt(t*t+i*i)}},{"./create":22}],27:[function(t,i){i.exports=function(t,i,e,n,r,s){var o=t.width,h=t.height,a=t.left,u=t.right,f=t.top,c=t.bottom;a="number"==typeof a&&a===a?a:0,u="number"==typeof u&&u===u?u:0,f="number"==typeof f&&f===f?f:0,c="number"==typeof c&&c===c?c:0,o=o-a-u,h=h-f-c,r||(i=Math.max(i-a-u,0),e=Math.max(e-f-c,0));var p=0;if(f>0&&a>0&&s(p++,0,0,a,f,0,0,a,f),c>0&&a>0&&s(p++,0,h+f,a,c,0,e+f,a,c),f>0&&u>0&&s(p++,o+a,0,u,f,i+a,0,u,f),c>0&&u>0&&s(p++,o+a,h+f,u,c,i+a,e+f,u,c),n)f>0&&s(p++,a,0,o,f,a,0,i,f),c>0&&s(p++,a,h+f,o,c,a,e+f,i,c),a>0&&s(p++,0,f,a,h,0,f,a,e),u>0&&s(p++,o+a,f,u,h,i+a,f,u,e),s(p++,a,f,o,h,a,f,i,e);else for(var l,_=a,d=i;d>0;){l=Math.min(o,d),d-=o;for(var g,y=f,m=e;m>0;)g=Math.min(h,m),m-=h,s(p++,a,f,l,g,_,y,l,g),0>=d&&(a&&s(p++,0,f,a,g,0,y,a,g),u&&s(p++,o+a,f,u,g,_+l,y,u,g)),y+=g;f&&s(p++,a,0,l,f,_,0,l,f),c&&s(p++,a,h+f,l,c,_,y,l,c),_+=l}return p}},{}],28:[function(t,i){i.exports={}},{}],29:[function(t,i){i.exports.startsWith=function(t,i){return"string"==typeof t&&"string"==typeof i&&t.substring(0,i.length)==i}},{}]},{},[1])(1)}); |
2
package.json
0 comments on commit
ab39788