UNPKG

matting-editor

Version:

matting-editor

1 lines 683 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("lodash"),require("jQuery")):"function"==typeof define&&define.amd?define(["lodash","jQuery"],e):"object"==typeof exports?exports.MattingEditor=e(require("lodash"),require("jQuery")):t.MattingEditor=e(t.lodash,t.jQuery)}(window,function(__WEBPACK_EXTERNAL_MODULE__67__,__WEBPACK_EXTERNAL_MODULE__120__){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=507)}([function(t,e,n){var r=n(5),i=n(38),o=n(17),a=n(28),s=n(24),u=function(t,e,n){var l,c,h,f,d=t&u.F,p=t&u.G,v=t&u.S,g=t&u.P,y=t&u.B,m=p?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,_=p?i:i[e]||(i[e]={}),b=_.prototype||(_.prototype={});for(l in p&&(n=e),n)h=((c=!d&&m&&void 0!==m[l])?m:n)[l],f=y&&c?s(h,r):g&&"function"==typeof h?s(Function.call,h):h,m&&a(m,l,h,t&u.U),_[l]!=h&&o(_,l,f),g&&b[l]!=h&&(b[l]=h)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){"use strict";e.__esModule=!0;e.VERSION="4.7.3",e.PI_2=2*Math.PI,e.RAD_TO_DEG=180/Math.PI,e.DEG_TO_RAD=Math.PI/180,e.RENDERER_TYPE={UNKNOWN:0,WEBGL:1,CANVAS:2},e.BLEND_MODES={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19},e.DRAW_MODES={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},e.SCALE_MODES={LINEAR:0,NEAREST:1},e.WRAP_MODES={CLAMP:0,REPEAT:1,MIRRORED_REPEAT:2},e.GC_MODES={AUTO:0,MANUAL:1},e.URL_FILE_EXTENSION=/\.(\w{3,4})(?:$|\?|#)/i,e.DATA_URI=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;(charset=[\w-]+|base64))?,(.*)/i,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},e.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},e.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},e.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},e.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},function(t,e,n){"use strict";e.__esModule=!0,e.autoDetectRenderer=e.Application=e.Filter=e.SpriteMaskFilter=e.Quad=e.RenderTarget=e.ObjectRenderer=e.WebGLManager=e.Shader=e.CanvasRenderTarget=e.TextureUvs=e.VideoBaseTexture=e.BaseRenderTexture=e.RenderTexture=e.BaseTexture=e.TextureMatrix=e.Texture=e.Spritesheet=e.CanvasGraphicsRenderer=e.GraphicsRenderer=e.GraphicsData=e.Graphics=e.TextMetrics=e.TextStyle=e.Text=e.SpriteRenderer=e.CanvasTinter=e.CanvasSpriteRenderer=e.Sprite=e.TransformBase=e.TransformStatic=e.Transform=e.Container=e.DisplayObject=e.Bounds=e.glCore=e.WebGLRenderer=e.CanvasRenderer=e.ticker=e.utils=e.settings=void 0;var r=n(1);Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})});var i=n(10);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})});var o=n(13);Object.defineProperty(e,"glCore",{enumerable:!0,get:function(){return Y(o).default}});var a=n(88);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function(){return Y(a).default}});var s=n(162);Object.defineProperty(e,"DisplayObject",{enumerable:!0,get:function(){return Y(s).default}});var u=n(56);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return Y(u).default}});var l=n(160);Object.defineProperty(e,"Transform",{enumerable:!0,get:function(){return Y(l).default}});var c=n(161);Object.defineProperty(e,"TransformStatic",{enumerable:!0,get:function(){return Y(c).default}});var h=n(86);Object.defineProperty(e,"TransformBase",{enumerable:!0,get:function(){return Y(h).default}});var f=n(84);Object.defineProperty(e,"Sprite",{enumerable:!0,get:function(){return Y(f).default}});var d=n(323);Object.defineProperty(e,"CanvasSpriteRenderer",{enumerable:!0,get:function(){return Y(d).default}});var p=n(80);Object.defineProperty(e,"CanvasTinter",{enumerable:!0,get:function(){return Y(p).default}});var v=n(320);Object.defineProperty(e,"SpriteRenderer",{enumerable:!0,get:function(){return Y(v).default}});var g=n(305);Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return Y(g).default}});var y=n(147);Object.defineProperty(e,"TextStyle",{enumerable:!0,get:function(){return Y(y).default}});var m=n(146);Object.defineProperty(e,"TextMetrics",{enumerable:!0,get:function(){return Y(m).default}});var _=n(303);Object.defineProperty(e,"Graphics",{enumerable:!0,get:function(){return Y(_).default}});var b=n(145);Object.defineProperty(e,"GraphicsData",{enumerable:!0,get:function(){return Y(b).default}});var x=n(301);Object.defineProperty(e,"GraphicsRenderer",{enumerable:!0,get:function(){return Y(x).default}});var w=n(294);Object.defineProperty(e,"CanvasGraphicsRenderer",{enumerable:!0,get:function(){return Y(w).default}});var T=n(293);Object.defineProperty(e,"Spritesheet",{enumerable:!0,get:function(){return Y(T).default}});var E=n(25);Object.defineProperty(e,"Texture",{enumerable:!0,get:function(){return Y(E).default}});var S=n(149);Object.defineProperty(e,"TextureMatrix",{enumerable:!0,get:function(){return Y(S).default}});var O=n(40);Object.defineProperty(e,"BaseTexture",{enumerable:!0,get:function(){return Y(O).default}});var P=n(81);Object.defineProperty(e,"RenderTexture",{enumerable:!0,get:function(){return Y(P).default}});var C=n(154);Object.defineProperty(e,"BaseRenderTexture",{enumerable:!0,get:function(){return Y(C).default}});var M=n(157);Object.defineProperty(e,"VideoBaseTexture",{enumerable:!0,get:function(){return Y(M).default}});var A=n(156);Object.defineProperty(e,"TextureUvs",{enumerable:!0,get:function(){return Y(A).default}});var R=n(153);Object.defineProperty(e,"CanvasRenderTarget",{enumerable:!0,get:function(){return Y(R).default}});var I=n(53);Object.defineProperty(e,"Shader",{enumerable:!0,get:function(){return Y(I).default}});var D=n(54);Object.defineProperty(e,"WebGLManager",{enumerable:!0,get:function(){return Y(D).default}});var k=n(66);Object.defineProperty(e,"ObjectRenderer",{enumerable:!0,get:function(){return Y(k).default}});var L=n(64);Object.defineProperty(e,"RenderTarget",{enumerable:!0,get:function(){return Y(L).default}});var j=n(148);Object.defineProperty(e,"Quad",{enumerable:!0,get:function(){return Y(j).default}});var F=n(151);Object.defineProperty(e,"SpriteMaskFilter",{enumerable:!0,get:function(){return Y(F).default}});var N=n(150);Object.defineProperty(e,"Filter",{enumerable:!0,get:function(){return Y(N).default}});var B=n(144);Object.defineProperty(e,"Application",{enumerable:!0,get:function(){return Y(B).default}});var U=n(143);Object.defineProperty(e,"autoDetectRenderer",{enumerable:!0,get:function(){return U.autoDetectRenderer}});var X=z(n(3)),H=z(n(82)),G=Y(n(8)),W=Y(n(55)),V=Y(n(65));function z(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function Y(t){return t&&t.__esModule?t:{default:t}}e.settings=G.default,e.utils=X,e.ticker=H,e.CanvasRenderer=W.default,e.WebGLRenderer=V.default},function(t,e,n){"use strict";e.__esModule=!0,e.premultiplyBlendMode=e.BaseTextureCache=e.TextureCache=e.earcut=e.mixins=e.pluginTarget=e.EventEmitter=e.removeItems=e.isMobile=void 0,e.uid=function(){return++p},e.hex2rgb=function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},e.hex2string=function(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)},e.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},e.getResolutionOfUrl=function(t,e){var n=i.default.RETINA_PREFIX.exec(t);if(n)return parseFloat(n[1]);return void 0!==e?e:1},e.decomposeDataUri=function(t){var e=r.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,encoding:e[3]?e[3].toLowerCase():void 0,data:e[4]};return},e.getUrlFileExtension=function(t){var e=r.URL_FILE_EXTENSION.exec(t);if(e)return e[1].toLowerCase();return},e.getSvgSize=function(t){var e=r.SVG_SIZE.exec(t),n={};e&&(n[e[1]]=Math.round(parseFloat(e[3])),n[e[5]]=Math.round(parseFloat(e[7])));return n},e.skipHello=function(){v=!0},e.sayHello=function(t){if(v)return;if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+r.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+r.VERSION+" - "+t+" - http://www.pixijs.com/");v=!0},e.isWebGLSupported=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),n=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!n||!n.getContextAttributes().stencil);if(n){var i=n.getExtension("WEBGL_lose_context");i&&i.loseContext()}return n=null,r}catch(t){return!1}},e.sign=function(t){return 0===t?0:t<0?-1:1},e.destroyTextureCache=function(){var t=void 0;for(t in g)g[t].destroy();for(t in y)y[t].destroy()},e.clearTextureCache=function(){var t=void 0;for(t in g)delete g[t];for(t in y)delete y[t]},e.correctBlendMode=function(t,e){return m[e?1:0][t]},e.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var n=t>>16&255,r=t>>8&255,i=255&t;return(255*e<<24)+((n=n*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(i=i*e+.5|0)},e.premultiplyRgba=function(t,e,n,r){n=n||new Float32Array(4),r||void 0===r?(n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e):(n[0]=t[0],n[1]=t[1],n[2]=t[2]);return n[3]=e,n},e.premultiplyTintToRgba=function(t,e,n,r){(n=n||new Float32Array(4))[0]=(t>>16&255)/255,n[1]=(t>>8&255)/255,n[2]=(255&t)/255,(r||void 0===r)&&(n[0]*=e,n[1]*=e,n[2]*=e);return n[3]=e,n};var r=n(1),i=d(n(8)),o=d(n(29)),a=d(n(335)),s=f(n(334)),u=f(n(87)),l=d(n(333)),c=d(n(332)),h=d(n(85));function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var p=0,v=!1;e.isMobile=u,e.removeItems=l.default,e.EventEmitter=o.default,e.pluginTarget=a.default,e.mixins=s,e.earcut=h.default;var g=e.TextureCache=Object.create(null),y=e.BaseTextureCache=Object.create(null);var m=e.premultiplyBlendMode=(0,c.default)()},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(4);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(113)("wks"),i=n(36),o=n(5).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){"use strict";e.__esModule=!0;var r=o(n(337)),i=o(n(336));function o(t){return t&&t.__esModule?t:{default:t}}e.default={TARGET_FPMS:.06,MIPMAP_TEXTURES:!0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:(0,r.default)(32),SPRITE_BATCH_SIZE:4096,RETINA_PREFIX:/@([0-9\.]+)x/,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1,width:800,height:600,legacy:!1},TRANSFORM_MODE:0,GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:0,SCALE_MODE:0,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:"mediump",CAN_UPLOAD_SAME_BUFFER:(0,i.default)(),MESH_CANVAS_PADDING:0}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(92);Object.defineProperty(e,"Point",{enumerable:!0,get:function(){return f(r).default}});var i=n(173);Object.defineProperty(e,"ObservablePoint",{enumerable:!0,get:function(){return f(i).default}});var o=n(91);Object.defineProperty(e,"Matrix",{enumerable:!0,get:function(){return f(o).default}});var a=n(172);Object.defineProperty(e,"GroupD8",{enumerable:!0,get:function(){return f(a).default}});var s=n(347);Object.defineProperty(e,"Circle",{enumerable:!0,get:function(){return f(s).default}});var u=n(346);Object.defineProperty(e,"Ellipse",{enumerable:!0,get:function(){return f(u).default}});var l=n(345);Object.defineProperty(e,"Polygon",{enumerable:!0,get:function(){return f(l).default}});var c=n(90);Object.defineProperty(e,"Rectangle",{enumerable:!0,get:function(){return f(c).default}});var h=n(344);function f(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"RoundedRectangle",{enumerable:!0,get:function(){return f(h).default}})},function(t,e,n){var r=n(6),i=n(204),o=n(62),a=Object.defineProperty;e.f=n(15)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(33),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r={createContext:n(343),setVertexAttribArrays:n(171),GLBuffer:n(342),GLFramebuffer:n(341),GLShader:n(340),GLTexture:n(170),VertexArrayObject:n(339),shader:n(338)};void 0!==t&&t.exports&&(t.exports=r),"undefined"!=typeof window&&(window.PIXI=window.PIXI||{},window.PIXI.glCore=r)},function(t,e,n){"use strict";var r=n(180),i=n(395),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function l(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:i,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:l,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,i=arguments.length;r<i;r++)l(arguments[r],n);return e},extend:function(t,e,n){return l(e,function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){t.exports=!n(9)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(11),i=n(37);t.exports=n(15)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return r.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}e.resolve=function(){for(var e="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var a=i>=0?arguments[i]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return e=n(o(e.split("/"),function(t){return!!t}),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),i="/"===a(t,-1);return(t=n(o(t.split("/"),function(t){return!!t}),!r).join("/"))||r||(t="."),t&&i&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u<a;u++)if(i[u]!==o[u]){s=u;break}var l=[];for(u=s;u<i.length;u++)l.push("..");return(l=l.concat(o.slice(s))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){var e=i(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},e.basename=function(t,e){var n=i(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){return i(t)[3]};var a="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(68))},function(t,e,n){var r=n(0),i=n(38),o=n(9);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(t,e,n){var r=n(116),i=n(32);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(58),i=n(37),o=n(20),a=n(62),s=n(16),u=n(204),l=Object.getOwnPropertyDescriptor;e.f=n(15)?l:function(t,e){if(t=o(t),e=a(e,!0),u)try{return l(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){"use strict";if(n(15)){var r=n(34),i=n(5),o=n(9),a=n(0),s=n(117),u=n(203),l=n(24),c=n(49),h=n(37),f=n(17),d=n(50),p=n(33),v=n(12),g=n(202),y=n(47),m=n(62),_=n(16),b=n(109),x=n(4),w=n(23),T=n(108),E=n(60),S=n(44),O=n(61).f,P=n(107),C=n(36),M=n(7),A=n(59),R=n(115),I=n(110),D=n(106),k=n(45),L=n(74),j=n(75),F=n(111),N=n(196),B=n(11),U=n(21),X=B.f,H=U.f,G=i.RangeError,W=i.TypeError,V=i.Uint8Array,z=Array.prototype,Y=u.ArrayBuffer,q=u.DataView,$=A(0),K=A(2),J=A(3),Z=A(4),Q=A(5),tt=A(6),et=R(!0),nt=R(!1),rt=D.values,it=D.keys,ot=D.entries,at=z.lastIndexOf,st=z.reduce,ut=z.reduceRight,lt=z.join,ct=z.sort,ht=z.slice,ft=z.toString,dt=z.toLocaleString,pt=M("iterator"),vt=M("toStringTag"),gt=C("typed_constructor"),yt=C("def_constructor"),mt=s.CONSTR,_t=s.TYPED,bt=s.VIEW,xt=A(1,function(t,e){return Ot(I(t,t[yt]),e)}),wt=o(function(){return 1===new V(new Uint16Array([1]).buffer)[0]}),Tt=!!V&&!!V.prototype.set&&o(function(){new V(1).set({})}),Et=function(t,e){var n=p(t);if(n<0||n%e)throw G("Wrong offset!");return n},St=function(t){if(x(t)&&_t in t)return t;throw W(t+" is not a typed array!")},Ot=function(t,e){if(!(x(t)&&gt in t))throw W("It is not a typed array constructor!");return new t(e)},Pt=function(t,e){return Ct(I(t,t[yt]),e)},Ct=function(t,e){for(var n=0,r=e.length,i=Ot(t,r);r>n;)i[n]=e[n++];return i},Mt=function(t,e,n){X(t,e,{get:function(){return this._d[n]}})},At=function(t){var e,n,r,i,o,a,s=w(t),u=arguments.length,c=u>1?arguments[1]:void 0,h=void 0!==c,f=P(s);if(void 0!=f&&!T(f)){for(a=f.call(s),r=[],e=0;!(o=a.next()).done;e++)r.push(o.value);s=r}for(h&&u>2&&(c=l(c,arguments[2],2)),e=0,n=v(s.length),i=Ot(this,n);n>e;e++)i[e]=h?c(s[e],e):s[e];return i},Rt=function(){for(var t=0,e=arguments.length,n=Ot(this,e);e>t;)n[t]=arguments[t++];return n},It=!!V&&o(function(){dt.call(new V(1))}),Dt=function(){return dt.apply(It?ht.call(St(this)):St(this),arguments)},kt={copyWithin:function(t,e){return N.call(St(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return Z(St(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return F.apply(St(this),arguments)},filter:function(t){return Pt(this,K(St(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return Q(St(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(St(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){$(St(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(St(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(St(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return lt.apply(St(this),arguments)},lastIndexOf:function(t){return at.apply(St(this),arguments)},map:function(t){return xt(St(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return st.apply(St(this),arguments)},reduceRight:function(t){return ut.apply(St(this),arguments)},reverse:function(){for(var t,e=St(this).length,n=Math.floor(e/2),r=0;r<n;)t=this[r],this[r++]=this[--e],this[e]=t;return this},some:function(t){return J(St(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return ct.call(St(this),t)},subarray:function(t,e){var n=St(this),r=n.length,i=y(t,r);return new(I(n,n[yt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?r:y(e,r))-i))}},Lt=function(t,e){return Pt(this,ht.call(St(this),t,e))},jt=function(t){St(this);var e=Et(arguments[1],1),n=this.length,r=w(t),i=v(r.length),o=0;if(i+e>n)throw G("Wrong length!");for(;o<i;)this[e+o]=r[o++]},Ft={entries:function(){return ot.call(St(this))},keys:function(){return it.call(St(this))},values:function(){return rt.call(St(this))}},Nt=function(t,e){return x(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Bt=function(t,e){return Nt(t,e=m(e,!0))?h(2,t[e]):H(t,e)},Ut=function(t,e,n){return!(Nt(t,e=m(e,!0))&&x(n)&&_(n,"value"))||_(n,"get")||_(n,"set")||n.configurable||_(n,"writable")&&!n.writable||_(n,"enumerable")&&!n.enumerable?X(t,e,n):(t[e]=n.value,t)};mt||(U.f=Bt,B.f=Ut),a(a.S+a.F*!mt,"Object",{getOwnPropertyDescriptor:Bt,defineProperty:Ut}),o(function(){ft.call({})})&&(ft=dt=function(){return lt.call(this)});var Xt=d({},kt);d(Xt,Ft),f(Xt,pt,Ft.values),d(Xt,{slice:Lt,set:jt,constructor:function(){},toString:ft,toLocaleString:Dt}),Mt(Xt,"buffer","b"),Mt(Xt,"byteOffset","o"),Mt(Xt,"byteLength","l"),Mt(Xt,"length","e"),X(Xt,vt,{get:function(){return this[_t]}}),t.exports=function(t,e,n,u){var l=t+((u=!!u)?"Clamped":"")+"Array",h="get"+t,d="set"+t,p=i[l],y=p||{},m=p&&S(p),_=!p||!s.ABV,w={},T=p&&p.prototype,P=function(t,n){X(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[h](n*e+r.o,wt)}(this,n)},set:function(t){return function(t,n,r){var i=t._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[d](n*e+i.o,r,wt)}(this,n,t)},enumerable:!0})};_?(p=n(function(t,n,r,i){c(t,p,l,"_d");var o,a,s,u,h=0,d=0;if(x(n)){if(!(n instanceof Y||"ArrayBuffer"==(u=b(n))||"SharedArrayBuffer"==u))return _t in n?Ct(p,n):At.call(p,n);o=n,d=Et(r,e);var y=n.byteLength;if(void 0===i){if(y%e)throw G("Wrong length!");if((a=y-d)<0)throw G("Wrong length!")}else if((a=v(i)*e)+d>y)throw G("Wrong length!");s=a/e}else s=g(n),o=new Y(a=s*e);for(f(t,"_d",{b:o,o:d,l:a,e:s,v:new q(o)});h<s;)P(t,h++)}),T=p.prototype=E(Xt),f(T,"constructor",p)):o(function(){p(1)})&&o(function(){new p(-1)})&&L(function(t){new p,new p(null),new p(1.5),new p(t)},!0)||(p=n(function(t,n,r,i){var o;return c(t,p,l),x(n)?n instanceof Y||"ArrayBuffer"==(o=b(n))||"SharedArrayBuffer"==o?void 0!==i?new y(n,Et(r,e),i):void 0!==r?new y(n,Et(r,e)):new y(n):_t in n?Ct(p,n):At.call(p,n):new y(g(n))}),$(m!==Function.prototype?O(y).concat(O(m)):O(y),function(t){t in p||f(p,t,y[t])}),p.prototype=T,r||(T.constructor=p));var C=T[pt],M=!!C&&("values"==C.name||void 0==C.name),A=Ft.values;f(p,gt,!0),f(T,_t,l),f(T,bt,!0),f(T,yt,p),(u?new p(1)[vt]==l:vt in T)||X(T,vt,{get:function(){return l}}),w[l]=p,a(a.G+a.W+a.F*(p!=y),w),a(a.S,l,{BYTES_PER_ELEMENT:e}),a(a.S+a.F*o(function(){y.of.call(p,1)}),l,{from:At,of:Rt}),"BYTES_PER_ELEMENT"in T||f(T,"BYTES_PER_ELEMENT",e),a(a.P,l,kt),j(l),a(a.P+a.F*Tt,l,{set:jt}),a(a.P+a.F*!M,l,Ft),r||T.toString==ft||(T.toString=ft),a(a.P+a.F*o(function(){new p(1).slice()}),l,{slice:Lt}),a(a.P+a.F*(o(function(){return[1,2].toLocaleString()!=new p([1,2]).toLocaleString()})||!o(function(){T.toLocaleString.call([1,2])})),l,{toLocaleString:Dt}),k[l]=M?C:A,r||M||f(T,pt,A)}}else t.exports=function(){}},function(t,e,n){var r=n(32);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(35);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=h(n(40)),o=h(n(157)),a=h(n(156)),s=h(n(29)),u=n(10),l=n(3),c=h(n(8));function h(t){return t&&t.__esModule?t:{default:t}}var f=function(t){function e(n,r,i,o,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this));if(s.noFrame=!1,r||(s.noFrame=!0,r=new u.Rectangle(0,0,1,1)),n instanceof e&&(n=n.baseTexture),s.baseTexture=n,s._frame=r,s.trim=o,s.valid=!1,s.requiresUpdate=!1,s._uvs=null,s.orig=i||r,s._rotate=Number(a||0),!0===a)s._rotate=2;else if(s._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return n.hasLoaded?(s.noFrame&&(r=new u.Rectangle(0,0,n.width,n.height),n.on("update",s.onBaseTextureUpdated,s)),s.frame=r):n.once("loaded",s.onBaseTextureLoaded,s),s._updateID=0,s.transform=null,s.textureCacheIds=[],s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.update=function(){this.baseTexture.update()},e.prototype.onBaseTextureLoaded=function(t){this._updateID++,this.noFrame?this.frame=new u.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.baseTexture.on("update",this.onBaseTextureUpdated,this),this.emit("update",this)},e.prototype.onBaseTextureUpdated=function(t){this._updateID++,this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},e.prototype.destroy=function(t){this.baseTexture&&(t&&(l.TextureCache[this.baseTexture.imageUrl]&&e.removeFromCache(this.baseTexture.imageUrl),this.baseTexture.destroy()),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){return new e(this.baseTexture,this.frame,this.orig,this.trim,this.rotate)},e.prototype._updateUvs=function(){this._uvs||(this._uvs=new a.default),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.fromImage=function(t,n,r,o){var a=l.TextureCache[t];return a||(a=new e(i.default.fromImage(t,n,r,o)),e.addToCache(a,t)),a},e.fromFrame=function(t){var e=l.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},e.fromCanvas=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"canvas";return new e(i.default.fromCanvas(t,n,r))},e.fromVideo=function(t,n){return"string"==typeof t?e.fromVideoUrl(t,n):new e(o.default.fromVideo(t,n))},e.fromVideoUrl=function(t,n){return new e(o.default.fromUrl(t,n))},e.from=function(t){if("string"==typeof t){var n=l.TextureCache[t];return n||(null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/)?e.fromVideoUrl(t):e.fromImage(t))}return t instanceof HTMLImageElement?new e(i.default.from(t)):t instanceof HTMLCanvasElement?e.fromCanvas(t,c.default.SCALE_MODE,"HTMLCanvasElement"):t instanceof HTMLVideoElement?e.fromVideo(t):t instanceof i.default?new e(t):t},e.fromLoader=function(t,n,r){var o=new i.default(t,void 0,(0,l.getResolutionOfUrl)(n)),a=new e(o);return o.imageUrl=n,r||(r=n),i.default.addToCache(a.baseTexture,r),e.addToCache(a,r),r!==n&&(i.default.addToCache(a.baseTexture,n),e.addToCache(a,n)),a},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),l.TextureCache[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),l.TextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=l.TextureCache[t];if(e){var n=e.textureCacheIds.indexOf(t);return n>-1&&e.textureCacheIds.splice(n,1),delete l.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)l.TextureCache[t.textureCacheIds[r]]===t&&delete l.TextureCache[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},r(e,[{key:"frame",get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,n=t.y,r=t.width,i=t.height,o=e+r>this.baseTexture.width,a=n+i>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,l="Y: "+n+" + "+i+" = "+(n+i)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+l)}this.valid=r&&i&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=t),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),e}(s.default);function d(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}e.default=f,f.EMPTY=new f(new i.default),d(f.EMPTY),d(f.EMPTY.baseTexture),f.WHITE=function(){var t=document.createElement("canvas");t.width=10,t.height=10;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,10,10),new f(new i.default(t))}(),d(f.WHITE),d(f.WHITE.baseTexture)},function(t,e,n){(function(e,n,r){t.exports=function(){var t,i,o;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n||t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){"use strict";e.exports=function(t){var e=t._SomePromiseArray;function n(t){var n=new e(t),r=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),r}t.any=function(t){return n(t)},t.prototype.any=function(){return n(this)}}},{}],2:[function(t,n,r){"use strict";var i;try{throw new Error}catch(t){i=t}var o=t("./schedule"),a=t("./queue"),s=t("./util");function u(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new a(16),this._normalQueue=new a(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=o}function l(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function c(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function h(t){this._normalQueue._pushOne(t),this._queueTick()}u.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(t,n){n?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},u.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(u.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?l.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},u.prototype.invoke=function(t,e,n){this._trampolineEnabled?c.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},u.prototype.settlePromises=function(t){this._trampolineEnabled?h.call(this,t):this._schedule(function(){t._settlePromises()})}):(u.prototype.invokeLater=l,u.prototype.invoke=c,u.prototype.settlePromises=h),u.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},u.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},u.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},u.prototype._reset=function(){this._isTickUsed=!1},n.exports=u,n.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),c=new t(e);c._propagateFrom(this,1);var h=this._target();if(c._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:c,target:h,bindingPromise:l};h._then(e,a,void 0,c,f),l._then(s,u,void 0,c,f),c._setOnCancel(l)}else c._resolveCallback(h);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";var r;"undefined"!=typeof Promise&&(r=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=r)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){var n=t("./util"),r=n.canEvaluate;function i(t){var r=this.pop(),i=function(t,r){var i;if(null!=t&&(i=t[r]),"function"!=typeof i){var o="Object "+n.classString(t)+" has no method '"+n.toString(r)+"'";throw new e.TypeError(o)}return i}(t,r);return i.apply(t,this)}function o(t){return t[this]}function a(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}n.isIdentifier,e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(i,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=a;else if(r){var i=(void 0)(t);e=null!==i?i:o}else e=o;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if("function"==typeof t){if(!e){var r=a(t).call(this._boundValue());r===s&&(this._attachExtraTrace(r.e),u.throwLater(r.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){var n=t("./util"),r=t("./es5").keys,i=n.tryCatch,o=n.errorObj;return function(t,a,s){return function(u){var l=s._boundValue();t:for(var c=0;c<t.length;++c){var h=t[c];if(h===Error||null!=h&&h.prototype instanceof Error){if(u instanceof h)return i(a).call(l,u)}else if("function"==typeof h){var f=i(h).call(l,u);if(f===o)return f;if(f)return i(a).call(l,u)}else if(n.isObject(u)){for(var d=r(h),p=0;p<d.length;++p){var v=d[p];if(h[v]!=u[v])continue t}return i(a).call(l,u)}}return e}}}},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){var e=!1,n=[];function r(){this._trace=new r.CapturedTrace(i())}function i(){var t=n.length-1;if(t>=0)return n[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},r.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},r.prototype._popContext=function(){if(void 0!==this._trace){var t=n.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},r.CapturedTrace=null,r.create=function(){if(e)return new r},r.deactivateLongStackTraces=function(){},r.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;r.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=r.prototype._pushContext,t.prototype._popContext=r.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},r}},{}],9:[function(t,n,r){"use strict";n.exports=function(n,r){var i,o,a,s=n._getDomain,u=n._async,l=t("./errors").Warning,c=t("./util"),h=c.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,p=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,g=null,y=!1,m=!(0==c.env("BLUEBIRD_DEBUG")),_=!(0==c.env("BLUEBIRD_WARNINGS")||!m&&!c.env("BLUEBIRD_WARNINGS")),b=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!m&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),x=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(_||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));n.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},n.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},n.prototype._notifyUnhandledRejectionIsHandled=function(){G("rejectionHandled",i,void 0,this)},n.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},n.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},n.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),G("unhandledRejection",o,t,this)}},n.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},n.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},n.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},n.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},n.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},n.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},n.prototype._warn=function(t,e,n){return B(t,e,n||this)},n.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:c.domainBind(e,t):void 0},n.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:c.domainBind(e,t):void 0};var w=function(){};n.longStackTraces=function(){if(u.haveItemsQueued()&&!J.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!J.longStackTraces&&V()){var t=n.prototype._captureStackTrace,e=n.prototype._attachExtraTrace;J.longStackTraces=!0,w=function(){if(u.haveItemsQueued()&&!J.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");n.prototype._captureStackTrace=t,n.prototype._attachExtraTrace=e,r.deactivateLongStackTraces(),u.enableTrampoline(),J.longStackTraces=!1},n.prototype._captureStackTrace=F,n.prototype._attachExtraTrace=N,r.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},n.hasLongStackTraces=function(){return J.longStackTraces&&V()};var T=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!c.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!c.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!c.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),E=c.isNode?function(){return e.emit.apply(e,arguments)}:c.global?function(t){var e="on"+t.toLowerCase(),n=c.global[e];return!!n&&(n.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(t,e){return{promise:e}}var O={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:S},P=function(t){var e=!1;try{e=E.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var n=!1;try{n=T(t,O[t].apply(null,arguments))}catch(t){u.throwLater(t),n=!0}return n||e};function C(){return!1}function M(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+c.toString(t));r._attachCancellationCallback(t)})}catch(t){return t}}function A(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?c.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function R(){return this._onCancelField}function I(t){this._onCancelField=t}function D(){this._cancellationParent=void 0,this._onCancelField=void 0}function k(t,e){if(0!=(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}n.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?n.longStackTraces():!t.longStackTraces&&n.hasLongStackTraces()&&w()),"warnings"in t){var e=t.warnings;J.warnings=!!e,x=J.warnings,c.isObject(e)&&"wForgottenReturn"in e&&(x=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!J.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");n.prototype._clearCancellationData=D,n.prototype._propagateFrom=k,n.prototype._onCancel=R,n.prototype._setOnCancel=I,n.prototype._attachCancellationCallback=A,n.prototype._execute=M,L=k,J.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!J.monitoring?(J.monitoring=!0,n.prototype._fireEvent=P):!t.monitoring&&J.monitoring&&(J.monitoring=!1,n.prototype._fireEvent=C)),n},n.prototype._fireEvent=C,n.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},n.prototype._onCancel=function(){},n.prototype._setOnCancel=function(t){},n.prototype._attachCancellationCallback=function(t){},n.prototype._captureStackTrace=function(){},n.prototype._attachExtraTrace=function(){},n.prototype._clearCancellationData=function(){},n.prototype._propagateFrom=function(t,e){};var L=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function j(){var t=this._boundTo;return void 0!==t&&t instanceof n?t.isFulfilled()?t.value():void 0:t}function F(){this._trace=new $(this._peekContext())}function N(t,e){if(h(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=X(t);c.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),c.notEnumerableProp(t,"__stackCleaned__",!0)}}}function B(t,e,r){if(J.warnings){var i,o=new l(t);if(e)r._attachExtraTrace(o);else if(J.longStackTraces&&(i=n._peekContext()))i.attachExtraTrace(o);else{var a=X(o);o.stack=a.message+"\n"+a.stack.join("\n")}P("warning",o)||H(o,"",!0)}}function U(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],i=" (No stack trace)"===r||v.test(r),o=i&&z(r);i&&!o&&(y&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}return e}function X(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if(" (No stack trace)"===r||v.test(r))break}return n>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:U(e)}}function H(t,e,n){if("undefined"!=typeof console){var r;if(c.isObject(t)){var i=t.stack;r=e+g(i,t)}else r=e+String(t);"function"==typeof a?a(r,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function G(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(t){u.throwLater(t)}"unhandledRejection"===t?P(t,n,r)||i||H(n,"Unhandled rejection "):P(t,r)}function W(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{if(e=t&&"function"==typeof t.toString?t.toString():c.toString(t),/\[object [a-zA-Z0-9$_]+\]/.test(e))try{var n=JSON.stringify(t);e=n}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){return t.length<41?t:t.substr(0,38)+"..."}(e)+">, no stack trace)"}function V(){return"function"==typeof K}var z=function(){return!1},Y=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function q(t){var e=t.match(Y);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function $(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);K(this,$),e>32&&this.uncycle()}c.inherits($,Error),r.CapturedTrace=$,$.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;for(var r=(t=this._length=r)-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;r<t;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var u=r>0?e[r-1]:this;s<t-1?(u._parent=e[s+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var l=u._length+1,c=r-2;c>=0;--c)e[c]._length=l,l++;return}}}},$.