From 7515062810c472d6b6f23168e80624b5a4461ffe Mon Sep 17 00:00:00 2001 From: Mient - jan Stelling Date: Wed, 4 May 2016 22:38:43 +0200 Subject: [PATCH] needs a few more fixes --- bin/pixi-flump.js | 9 +++++---- bin/pixi-flump.js.map | 2 +- bin/pixi-flump.min.js | 2 +- bin/pixi-flump.min.js.map | 2 +- src/core/MovieLayer.js | 5 +++-- src/core/MovieLayer.ts | 13 +++++++------ 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/bin/pixi-flump.js b/bin/pixi-flump.js index 3e3c058..1b3c6e0 100644 --- a/bin/pixi-flump.js +++ b/bin/pixi-flump.js @@ -1,7 +1,7 @@ /** * @license * pixi-flump.js - v1.0.0 - * Compiled 2016-05-04T20:28:21.196Z + * Compiled 2016-05-04T20:34:37.513Z * * pixi-flump.js is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -443,16 +443,17 @@ var MovieLayer = (function (_super) { var keyframe = this._layerData.getKeyframeForFrame(Math.floor(frame)); if (keyframe.ref != -1 && keyframe.ref != null) { if (this._symbol != this._symbols[keyframe.ref]) { - this._movie.removeChild(this._symbol); + this.removeChildren(); this._symbol = this._symbols[keyframe.ref]; if (this._symbol instanceof FlumpMovie_1.FlumpMovie) { this._symbol.reset(); } - this._movie.addChild(this._symbol); + this.addChild(this._symbol); } this.setKeyframeData(this._symbol, keyframe, frame); } else { + this.removeChildren(); this._symbol = null; } return true; @@ -1165,6 +1166,6 @@ exports.QueueItem = QueueItem; },{}]},{},[11])(11) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvRmx1bXBMaWJyYXJ5LmpzIiwic3JjL2NvcmUvRmx1bXBNb3ZpZS5qcyIsInNyYy9jb3JlL0ZsdW1wTXR4LmpzIiwic3Jj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vYWRlZCA9IHRydWU7XHJcbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcclxuICAgICAgICB9KTtcclxuICAgIH07XHJcbiAgICBGbHVtcExpYnJhcnkucHJvdG90eXBlLmdldE1vdmllRGF0YSA9IGZ1bmN0aW9uIChuYW1lKSB7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLm1vdmllRGF0YS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbW92aWVEYXRhID0gdGhpcy5tb3ZpZURhdGFbaV07XHJcbiAgICAgICAgICAgIGlmIChtb3ZpZURhdGEuaWQgPT0gbmFtZSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vdmllRGF0YTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ21vdmllIG5vdCBmb3VuZCcpO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTGlicmFyeS5wcm90b3R5cGUuY3JlYXRlU3ltYm9sID0gZnVuY3Rpb24gKG5hbWUsIHBhdXNlZCkge1xyXG4gICAgICAgIGlmIChwYXVzZWQgPT09IHZvaWQgMCkgeyBwYXVzZWQgPSBmYWxzZTsgfVxyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy50ZXh0dXJlR3JvdXBzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHZhciB0ZXh0dXJlcyA9IHRoaXMudGV4dHVyZUdyb3Vwc1tpXS5zcHJpdGVzO1xyXG4gICAgICAgICAgICBpZiAobmFtZSBpbiB0ZXh0dXJlcykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRleHR1cmVzW25hbWVdO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5tb3ZpZURhdGEubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgIC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IGZhbHNlKSB7XHJcbiAgICAgICAgICAgIHRoaXMuX3F1ZXVlLm9uVGljayhkZWx0YSk7XHJcbiAgICAgICAgICAgIHZhciBmcmFtZSA9IHRoaXMuZnJhbWU7XHJcbiAgICAgICAgICAgIHZhciBuZXdGcmFtZSA9IHRoaXMuX3F1ZXVlLmdldEZyYW1lKCk7XHJcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbW92aWVMYXllcnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIHZhciBsYXllciA9IG1vdmllTGF5ZXJzW2ldO1xyXG4gICAgICAgICAgICAgICAgbGF5ZXIub25UaWNrKGRlbHRhLCBhY2N1bXVsYXRlZCk7XHJcbiAgICAgICAgICAgICAgICBsYXllci5zZXRGcmFtZShuZXdGcmFtZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGhpcy5mcmFtZSA9IG5ld0ZyYW1lO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBGbHVtcE1vdmllLnByb3RvdHlwZS5nZXRTeW1ib2wgPSBmdW5jdGlvbiAobmFtZSkge1xyXG4gICAgICAgIHZhciBsYXllcnMgPSB0aGlzLl9tb3ZpZUxheWVycztcclxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxheWVycy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbGF5ZXIgPSBsYXllcnNbaV07XHJcbiAgICAgICAgICAgIHZhciBzeW1ib2wgPSBsYXllci5nZXRTeW1ib2wobmFtZSk7XHJcbiAgICAgICAgICAgIGlmIChzeW1ib2wgIT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH07XHJcbiAgICBGbHVtcE1vdmllLnByb3RvdHlwZS5yZXBsYWNlU3ltYm9sID0gZnVuY3Rpb24gKG5hbWUsIHN5bWJvbCkge1xyXG4gICAgICAgIHZhciBsYXllcnMgPSB0aGlzLl9tb3ZpZUxheWVycztcclxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxheWVycy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbGF5ZXIgPSBsYXllcnNbaV07XHJcbiAgICAgICAgICAgIGlmIChsYXllci5yZXBsYWNlU3ltYm9sKG5hbWUsIHN5bWJvbCkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH07XHJcbiAgICBGbHVtcE1vdmllLnByb3RvdHlwZS5oYW5kbGVGcmFtZUNhbGxiYWNrID0gZnVuY3Rpb24gKGZyb21GcmFtZSwgdG9GcmFtZSwgZGVsdGEpIHtcclxuICAgICAgICBpZiAodG9GcmFtZSA+IGZyb21GcmFtZSkge1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpbmRleCA9IGZyb21GcmFtZTsgaW5kZXggPCB0b0ZyYW1lOyBpbmRleCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVDYWxsYmFja1tpbmRleF0pIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XS5jYWxsKHRoaXMsIGRlbHRhKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICh0b0ZyYW1lIDwgZnJvbUZyYW1lKSB7XHJcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gZnJvbUZyYW1lOyBpbmRleCA8IHRoaXMuZnJhbWVzOyBpbmRleCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVDYWxsYmFja1tpbmRleF0pIHtcclxuICAgICA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c3ltYm9sc1trZXlmcmFtZS5yZWZdID0gbGlicmFyeS5jcmVhdGVTeW1ib2woa2V5ZnJhbWUucmVmLCBmYWxzZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5zZXRGcmFtZSgwKTtcclxuICAgIH1cclxuICAgIE1vdmllTGF5ZXIucHJvdG90eXBlLmdldFN5bWJvbCA9IGZ1bmN0aW9uIChuYW1lKSB7XHJcbiAgICAgICAgdmFyIHN5bWJvbHMgPSB0aGlzLl9zeW1ib2xzO1xyXG4gICAgICAgIGZvciAodmFyIHZhbCBpbiBzeW1ib2xzKSB7XHJcbiAgICAgICAgICAgIHZhciBzeW1ib2wgPSBzeW1ib2xzW3ZhbF07XHJcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW5zdGFuY2VvZiBGbHVtcE1vdmllXzEuRmx1bXBNb3ZpZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHN5bWJvbC5uYW1lID09IG5hbWUpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBzeW1ib2wuZ2V0U3ltYm9sKG5hbWUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhICE9IG51bGwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhdGE7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfTtcclxuICAgIE1vdmllTGF5ZXIucHJvdG90eXBlLnJlcGxhY2VTeW1ib2wgPSBmdW5jdGlvbiAobmFtZSwgaXRlbSkge1xyXG4gICAgICAgIHZhciBzeW1ib2xzID0gdGhpc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tMSAmJiBrZXlmcmFtZS5yZWYgIT0gbnVsbCkge1xyXG4gICAgICAgICAgICBpZiAodGhpcy5fc3ltYm9sICE9IHRoaXMuX3N5bWJvbHNba2V5ZnJhbWUucmVmXSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5fbW92aWUucmVtb3ZlQ2hpbGQodGhpcy5fc3ltYm9sKTtcclxuICAgICAgICAgICAgICAgIHRoaXMuX3N5bWJvbCA9IHRoaXMuX3N5bWJvbHNba2V5ZnJhbWUucmVmXTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9zeW1ib2wgaW5zdGFuY2VvZiBGbHVtcE1vdmllXzEuRmx1bXBNb3ZpZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3N5bWJvbC5yZXNldCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGhpcy5fbW92aWUuYWRkQ2hpbGQodGhpcy5fc3ltYm9sKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnNldEtleWZyYW1lRGF0YSh0aGlzLl9zeW1ib2wsIGtleWZyYW1lLCBmcmFtZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLl9zeW1ib2wgPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH07XHJcbiAgICBNb3ZpZUxheWVyLnByb3RvdHlwZS5zZXRLZXlmcmFtZURhdGEgPSBmdW5jdGlvbiAoc3ltYm9sLCBrZXlmcmFtZSwgZnJhbWUpIHtcclxuICAgICAgICB2YXIgc2luWCA9IDAuMDtcclxuICAgICAgICB2YXIgY29zWCA9IDEuMDtcclxuICAgICAgICB2YXIgc2luWSA9IDAuMDtcclxuICAgICAgICB2YXIgY29zWSA9IDEuMDtcclxuICAgICAgICB2YXIgeCA9IGtleWZyYW1lLng7XHJcbiAgICAgICAgdmFyIHkgPSBrZXlmcmFtZS55O1xyXG4gICAgICAgIHZhciBzY2FsZVggPSBrZXlmcmFtZS5zY2FsZVg7XHJcbiAgICAgICAgdmFyIHNjYWxlWSA9IGtleWZyYW1lLnNjYWxlWTtcclxuICAgICAgICB2YXIgc2tld1ggPSBrZXlmcmFtZS5za2V3WDtcclxuICAgICAgICB2YXIgc2tld1kgPSBrZXlmcmFtZS5za2V3WTtcclxuICAgICAgICB2YXIgcGl2b3RYID0ga2V5ZnJhbWUucGl2b3RYO1xyXG4gICAgICAgIHZhciBwaXZvdFkgPSBrZXlmcmFtZS5waXZvdFk7XHJcbiAgICAgICAgdmFyIGFscGhhID0ga2V5ZnJhbWUuYWxwaGE7XHJcbiAgICAgICAgdmFyIGVhc2U7XHJcbiAgICAgICAgdmFyIGludGVycGVkO1xyXG4gICAgICAgIHZhciBuZXh0S2V5ZnJhbWU7XHJcbiAgICAgICAgaWYgKGtleWZyYW1lLmluZGV4IDwgZnJhbWUgJiYga2V5ZnJhbWUudHdlZW5lZCkge1xyXG4gICAgICAgICAgICBuZXh0S2V5ZnJhbWUgPSB0aGlzLl9sYXllckRhdGEuZ2V0S2V5ZnJhbWVBZnRlcihrZXlmcmFtZSk7XHJcbiAgICAgICAgICAgIGlmIChuZXh0S2V5ZnJhbWUgaW5zdGFuY2VvZiBLZXlmcmFtZURhdGFfMS5LZXlmcmFtZURhdGEpIHtcclxuICAgICAgICAgICAgICAgIGludGVycGVkID0gKGZyYW1lIC0ga2V5ZnJhbWUuaW5kZXgpIC8ga2V5ZnJhbWUuZHVyYXRpb247XHJcbiAgICAgICAgICAgICAgICBlYXNlID0ga2V5ZnJhbWUuZWFzZTtcclxuICAgICAgICAgICAgICAgIGlmIChlYXNlICE9IDApIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IDAuMDtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZWFzZSA8IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGludiA9IDEgLSBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IDEgLSBpbnYgKiBpbnY7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVhc2UgPSAwIC0gZWFzZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBpbnRlcnBlZCAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpbnRlcnBlZCA9IGVhc2UgKiB0ICsgKDEgLSBlYXNlKSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgeCA9IHggKyAobmV4dEtleWZyYW1lLnggLSB4KSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgeSA9IHkgKyAobmV4dEtleWZyYW1lLnkgLSB5KSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgc2NhbGVYID0gc2NhbGVYICsgKG5leHRLZXlmcmFtZS5zY2FsZVggLSBzY2FsZVgpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICBzY2FsZVkgPSBzY2FsZVkgKyAobmV4dEtleWZyYW1lLnNjYWxlWSAtIHNjYWxlWSkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIHNrZXdYID0gc2tld1ggKyAobmV4dEtleWZyYW1lLnNrZXdYIC0gc2tld1gpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICBza2V3WSA9IHNrZXdZICsgKG5leHRLZXlmcmFtZS5za2V3WSAtIHNrZXdZKSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgYWxwaGEgPSBhbHBoYSArIChuZXh0S2V5ZnJhbWUuYWxwaGEgLSBhbHBoYSkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBzeW1ib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yXG4gICAgfVxyXG4gICAgS2V5ZnJhbWVEYXRhLnByb3RvdHlwZS5nZXRWYWx1ZU9yZGVyID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgICdpbmRleCcsXHJcbiAgICAgICAgICAgICdkdXJhdGlvbicsXHJcbiAgICAgICAgICAgICdyZWYnLFxyXG4gICAgICAgICAgICAnbGFiZWwnLFxyXG4gICAgICAgICAgICAneCcsICd5JyxcclxuICAgICAgICAgICAgJ3NjYWxlWCcsICdzY2FsZVknLFxyXG4gICAgICAgICAgICAnc2tld1gnLCAnc2tld1knLFxyXG4gICAgICAgICAgICAncGl2b3RYJywgJ3Bpdm90WScsXHJcbiAgICAgICAgICAgICd2aXNpYmxlJyxcclxuICAgICAgICAgICAgJ2FscGhhJyxcclxuICAgICAgICAgICAgJ3R3ZWVuZWQnLFxyXG4gICAgICAgICAgICAnZWFzZSdcclxuICAgICAgICBdO1xyXG4gICAgfTtcclxuICAgIEtleWZyYW1lRGF0YS5wcm90b3R5cGUudG9BcnJheSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgb3JkZXIgPSB0aGlzLmdldFZhbHVlT3JkZXIoKTtcclxuICAgICAgICB2YXIgZGF0YSA9IG5ldyBBcnJheShvcmRlci5sZW5ndGgpO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3JkZXIubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgdmFyIG5hbWUgPSBvcmRlcltpXTtcclxuICAgICAgICAgICAgZGF0YVtpXSA9IHRoaXNbbmFtZV07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBkYXRhO1xyXG4gICAgfTtcclxuICAgIEtleWZyYW1lRGF0YS5wcm90b3R5cGUuZnJvbUFycmF5ID0gZnVuY3Rpb24gKGRhdGEpIHtcclxuICAgICAgICB2YXIgb3JkZXIgPSB0aGlzLmdldFZhbHVlT3JkZXIoKTtcclx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HZlLCByZWplY3QpIHtcclxuICAgICAgICAgICAgdmFyIGNsaWVudCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpO1xyXG4gICAgICAgICAgICB2YXIgdXJpID0gdXJsO1xyXG4gICAgICAgICAgICBpZiAoYXJncyAmJiAobWV0aG9kID09PSAnUE9TVCcgfHwgbWV0aG9kID09PSAnUFVUJykpIHtcclxuICAgICAgICAgICAgICAgIHVyaSArPSAnPyc7XHJcbiAgICAgICAgICAgICAgICB2YXIgYXJnY291bnQgPSAwO1xyXG4gICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIGFyZ3MpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYXJncy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmdjb3VudCsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmkgKz0gJyYnO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHVyaSArPSBlbmNvZGVVUklDb21wb25lbnQoa2V5KSArICc9JyArIGVuY29kZVVSSUNvbXBvbmVudChhcmdzW2tleV0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjbGllbnQub3BlbihtZXRob2QsIHVyaSk7XHJcbiAgICAgICAgICAgIGNsaWVudC5zZW5kKCk7XHJcbiAgICAgICAgICAgIGNsaWVudC5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zdGF0dXMgPT09IDIwMCB8fCB0aGlzLnN0YXR1cyA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUodGhpcy5yZXNwb25zZSB8fCB0aGlzLnJlc3BvbnNlVGV4dCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbi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SB0cnVlO1xyXG4gICAgICAgIG9uUmVqZWN0ZWQoZXgpO1xyXG4gICAgfVxyXG59XHJcbnZhciBQcm9taXNlID0gKGZ1bmN0aW9uICgpIHtcclxuICAgIGZ1bmN0aW9uIFByb21pc2UoaW5pdCkge1xyXG4gICAgICAgIHRoaXMuX3N0YXRlID0gbnVsbDtcclxuICAgICAgICB0aGlzLl92YWx1ZSA9IG51bGw7XHJcbiAgICAgICAgdGhpcy5fZGVmZXJyZWRzID0gW107XHJcbiAgICAgICAgaWYgKHR5cGVvZiB0aGlzICE9PSAnb2JqZWN0JylcclxuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignUHJvbWlzZXMgbXVzdCBiZSBjb25zdHJ1Y3RlZCB2aWEgbmV3Jyk7XHJcbiAgICAgICAgaWYgKHR5cGVvZiBpbml0ICE9PSAnZnVuY3Rpb24nKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdub3QgYSBmdW5jdGlvbicpO1xyXG4gICAgICAgIGRvUmVzb2x2ZShpbml0LCByZXNvbHZlLmJpbmQodGhpcyksIHJlamVjdC5iaW5kKHRoaXMpKTtcclxuICAgIH1cclxuICAgIFByb21pc2UuYWxsID0gZnVuY3Rpb24gKHByb21pc2VMaXN0KSB7XHJcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcclxuICAgICAgICAgICAgaWYgKHByb21pc2VMaXN0Lmxlbmd0aCA9PT0gMClcclxuICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKFtdKTtcclxuICAgICAgICAgICAgdmFyIHJlbWFpbmluZyA9IHByb21pc2VMaXN0Lmxlbmd0aDtcclxuICAgICAgICAgICAgZnVuY3Rpb24gcmVzKGksIHZhbCkge1xyXG4gICAgICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAodmFsICYmICh0eXBlb2YgdmFsID09PSAnb2JqZWN0JyB8fCB0eXBlb2YgdmFsID09PSAnZnVuY3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhlbiA9IHZhbC50aGVuO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRoZW4gPT09ICdmdW5jdGlvbicpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZW4uY2FsbCh2YWwsIGZ1bmN0aW9uICh2YWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMoaSwgdmFsKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHJlamVjdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvbWlzZUxpc3RbaV0gPSB2YWw7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKC0tcmVtYWluaW5nID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUocHJvbWlzZUxpc3QpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhdGNoIChleCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChleCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwcm9taXNlTGlzdC5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgcmVzKGksIHByb21pc2VMaXN0W2ldKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfTtcclxuICAgIFByb21pc2UucmVzb2x2ZSA9IGZ1bmN0aW9uICh2YWx1ZSkge1xyXG4gICAgICAgIGlmICh2YWx1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lzdExlbmd0aCA+IDApIHtcclxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5fbGlzdC5zaGlmdCgpO1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0TGVuZ3RoLS07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcy5jdXJyZW50O1xyXG4gICAgfTtcclxuICAgIFF1ZXVlLnByb3RvdHlwZS5oYXNOZXh0ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9saXN0TGVuZ3RoID4gMDtcclxuICAgIH07XHJcbiAgICBRdWV1ZS5wcm90b3R5cGUuZW5kID0gZnVuY3Rpb24gKGFsbCkge1xyXG4gICAgICAgIGlmIChhbGwgPT09IHZvaWQgMCkgeyBhbGwgPSBmYWxzZTsgfVxyXG4gICAgICAgIGlmIChhbGwpIHtcclxuICAgICAgICAgICAgdGhpcy5fbGlzdC5sZW5ndGggPSAwO1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0TGVuZ3RoID0gMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuY3VycmVudCkge1xyXG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQudGltZXMgPSAxO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICBRdWV1ZS5wcm90b3R5cGUua2lsbCA9IGZ1bmN0aW9uIChhbGwpIHtcclxuICAgICAgICBpZiAoYWxsID09PSB2b2lkIDApIHsgYWxsID0gZmFsc2U7IH1cclxuICAgICAgICBpZiAoYWxsKSB7XHJcbiAgICAgICAgICAgIHRoaXMuX2xpc3QubGVuZ3RoID0gMDtcclxuICAgICAgICAgICAgdGhpcy5fbGlzdExlbmd0aCA9IDA7XHJcbiAgICAgICAgfVxyXG4gICAgICA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xyXG4gICAgfVxyXG4gICAgUXVldWVJdGVtLnByb3RvdHlwZS50aGVuID0gZnVuY3Rpb24gKGNvbXBsZXRlKSB7XHJcbiAgICAgICAgdGhpcy5fY29tcGxldGUgPSBjb21wbGV0ZTtcclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICBRdWV1ZUl0ZW0ucHJvdG90eXBlLmZpbmlzaCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBpZiAodGhpcy5fY29tcGxldGUpIHtcclxuICAgICAgICAgICAgdGhpcy5fY29tcGxldGUuY2FsbCh0aGlzKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHRoaXM7XHJcbiAgICB9O1xyXG4gICAgUXVldWVJdGVtLnByb3RvdHlwZS5kZXN0cnVjdCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB0aGlzLmxhYmVsID0gbnVsbDtcclxuICAgICAgICB0aGlzLl9jb21wbGV0ZSA9IG51bGw7XHJcbiAgICB9O1xyXG4gICAgcmV0dXJuIFF1ZXVlSXRlbTtcclxufSgpKTtcclxuZXhwb3J0cy5RdWV1ZUl0ZW0gPSBRdWV1ZUl0ZW07XHJcbiJdfQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvRmx1bXBMaWJyYXJ5LmpzIiwic3JjL2NvcmUvRmx1bXBNb3ZpZS5qcyIsInNyYy9jb3JlL0ZsdW1wTXR4LmpzIiwic3JjL2NvcmUvTW92aWVMYXllci5qcyIsInNyYy9jb3JlL1RleHR1cmVHcm91cC5qcyIsInNyYy9jb3JlL1RleHR1cmVHcm91cEF0bGFzLmpzIiwic3JjL2RhdGEvS2V5ZnJhbWVEYXRhLmpzIiwic3JjL2RhdGEvTGFiZWxEY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oYmFzZURpci5zdWJzdHIoLTEpID09ICcvJykge1xyXG4gICAgICAgICAgICAgICAgYmFzZURpciA9IGJhc2VEaXIuc3Vic3RyKDAsIGJhc2VEaXIubGVuZ3RoIC0gMSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdXJsICs9ICh1cmwuc3Vic3RyKHVybC5sZW5ndGggLSAxKSAhPSAnLycgPyAnLycgOiAnJykgKyAnbGlicmFyeS5qc29uJztcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGxpYnJhcnkgPT0gdm9pZCAwKSB7XHJcbiAgICAgICAgICAgIGxpYnJhcnkgPSBuZXcgRmx1bXBMaWJyYXJ5KGJhc2VEaXIpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgbGlicmFyeS51cmwgPSBiYXNlRGlyO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gSHR0cFJlcXVlc3RfMS5IdHRwUmVxdWVzdC5nZXRKU09OKHVybCkudGhlbihmdW5jdGlvbiAoanNvbikgeyByZXR1cm4gbGlicmFyeS5wcm9jZXNzRGF0YShqc29uLCBvblByb2Nlc3MpOyB9KTtcclxuICAgIH07XHJcbiAgICBGbHVtcExpYnJhcnkucHJvdG90eXBlLmhhc0xvYWRlZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5faGFzTG9hZGVkO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTGlicmFyeS5wcm90b3R5cGUuaXNMb2FkaW5nID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9pc0xvYWRpbmc7XHJcbiAgICB9O1xyXG4gICAgRmx1bXBMaWJyYXJ5LnByb3RvdHlwZS5sb2FkID0gZnVuY3Rpb24gKG9uUHJvZ3Jlc3MpIHtcclxuICAgICAgICBpZiAodGhpcy5oYXNMb2FkZWQoKSkge1xyXG4gICAgICAgICAgICBvblByb2dyZXNzK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UpIHtcclxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXMubW92aWVEYXRhLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHZhciBtb3ZpZURhdGEgPSB0aGlzLm1vdmllRGF0YVtpXTtcclxuICAgICAgICAgICAgaWYgKG1vdmllRGF0YS5pZCA9PSBuYW1lKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gbW92aWVEYXRhO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRocm93IG5ldyBFcnJvcignbW92aWUgbm90IGZvdW5kJyk7XHJcbiAgICB9O1xyXG4gICAgRmx1bXBMaWJyYXJ5LnByb3RvdHlwZS5jcmVhdGVTeW1ib2wgPSBmdW5jdGlvbiAobmFtZSwgcGF1c2VkKSB7XHJcbiAgICAgICAgaWYgKHBhdXNlZCA9PT0gdm9pZCAwKSB7IHBhdXNlZCA9IGZhbHNlOyB9XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLnRleHR1cmVHcm91cHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgdmFyIHRleHR1cmVzID0gdGhpcy50ZXh0dXJlR3JvdXBzW2ldLnNwcml0ZXM7XHJcbiAgICAgICAgICAgIGlmIChuYW1lIGluIHRleHR1cmVzKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdGV4dHVyZXNbbmFtZV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLm1vdmllRGF0YS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbW92aWVEYXRhID0gdGhpcy5tb3ZpZURhdGFbaV07XHJcbiAgICAgICAgICAgIGlmIChtb3ZpZURhdGEuaWQgPT0gbmFtZSkge1xyXG4gICAgICAgICAgICAgICAgdmFyIG1vdmllID0gbmV3IEZsdW1wTW92aWVfMS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AgdmFyIG5ld0ZyYW1lID0gdGhpcy5fcXVldWUuZ2V0RnJhbWUoKTtcclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBtb3ZpZUxheWVycy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgdmFyIGxheWVyID0gbW92aWVMYXllcnNbaV07XHJcbiAgICAgICAgICAgICAgICBsYXllci5vblRpY2soZGVsdGEsIGFjY3VtdWxhdGVkKTtcclxuICAgICAgICAgICAgICAgIGxheWVyLnNldEZyYW1lKG5ld0ZyYW1lKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmZyYW1lID0gbmV3RnJhbWU7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLmdldFN5bWJvbCA9IGZ1bmN0aW9uIChuYW1lKSB7XHJcbiAgICAgICAgdmFyIGxheWVycyA9IHRoaXMuX21vdmllTGF5ZXJzO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGF5ZXJzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHZhciBsYXllciA9IGxheWVyc1tpXTtcclxuICAgICAgICAgICAgdmFyIHN5bWJvbCA9IGxheWVyLmdldFN5bWJvbChuYW1lKTtcclxuICAgICAgICAgICAgaWYgKHN5bWJvbCAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLnJlcGxhY2VTeW1ib2wgPSBmdW5jdGlvbiAobmFtZSwgc3ltYm9sKSB7XHJcbiAgICAgICAgdmFyIGxheWVycyA9IHRoaXMuX21vdmllTGF5ZXJzO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGF5ZXJzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHZhciBsYXllciA9IGxheWVyc1tpXTtcclxuICAgICAgICAgICAgaWYgKGxheWVyLnJlcGxhY2VTeW1ib2wobmFtZSwgc3ltYm9sKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLmhhbmRsZUZyYW1lQ2FsbGJhY2sgPSBmdW5jdGlvbiAoZnJvbUZyYW1lLCB0b0ZyYW1lLCBkZWx0YSkge1xyXG4gICAgICAgIGlmICh0b0ZyYW1lID4gZnJvbUZyYW1lKSB7XHJcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gZnJvbUZyYW1lOyBpbmRleCA8IHRvRnJhbWU7IGluZGV4KyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdLmNhbGwodGhpcywgZGVsdGEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRvRnJhbWUgPCBmcm9tRnJhbWUpIHtcclxuICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggPSBmcm9tRnJhbWU7IGluZGV4IDwgdGhpcy5mcmFtZXM7IGluZGV4KyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdLmNhbGwodGhpcywgZGVsdGEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMDsgaW5kZXggPCB0b0ZyYW1lOyBpbmRleCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVDYWxsYmFja1tpbmRleF0pIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XS5jYWxsKHRoaXMsIGRlbHRhKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICBGbHVtcE1vdmllLnByb3RvdHlwZS5yZXNldCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgbGF5ZXJzID0gdGhpcy5fbW92aWVMYXllcnM7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsYXllcnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgdmFyIGxheWVyID0gbGF5ZXJzW2ldO1xyXG4gICAgICAgICAgICBsYXllci5yZXNldCgpO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICByZXR1cm4gRmx1bXBNb3ZpZTtcclxufShQSVhJLkNvbnRhaW5lcikpO1xyXG5leHBvcnRzLkZsdW1wTW92aWUgPSBGbHVtcE1vdmllO1xyXG4iLCJcInVzZSBzdHJpY3RcIjtcclxudmFyIEZsdW1wTXR4ID0gKGZ1bmN0aW9uICgpIHtcclxuICAgIGZ1bmN0aW9uIEZsdW1wTXR4KGEsIGIsIGMsIGQsIHR4LCB0eSkge1xyXG4gICAgICAgIHRoaXMuYSA9IGE7XHJcbiAgICAgICAgdGhpcy5iID0gYjtcclxuICAgICAgICB0aGlzLmMgPSBjO1xyXG4gICAgICAgIHRoaXMuZCA9IGQ7XHJcbiAgICAgICAgdGhpcy50eCA9IHR4O1xyXG4gICAgICAgIHRoaXMudHkgPSB0eTtcclxuICAgIH1c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LnNldEZyYW1lKDApO1xyXG4gICAgfVxyXG4gICAgTW92aWVMYXllci5wcm90b3R5cGUuZ2V0U3ltYm9sID0gZnVuY3Rpb24gKG5hbWUpIHtcclxuICAgICAgICB2YXIgc3ltYm9scyA9IHRoaXMuX3N5bWJvbHM7XHJcbiAgICAgICAgZm9yICh2YXIgdmFsIGluIHN5bWJvbHMpIHtcclxuICAgICAgICAgICAgdmFyIHN5bWJvbCA9IHN5bWJvbHNbdmFsXTtcclxuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbnN0YW5jZW9mIEZsdW1wTW92aWVfMS5GbHVtcE1vdmllKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoc3ltYm9sLm5hbWUgPT0gbmFtZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2w7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9IHN5bWJvbC5nZXRTeW1ib2wobmFtZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF0YTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9O1xyXG4gICAgTW92aWVMYXllci5wcm90b3R5cGUucmVwbGFjZVN5bWJvbCA9IGZ1bmN0aW9uIChuYW1lLCBpdGVtKSB7XHJcbiAgICAgICAgdmFyIHN5bWJvbHMgPSB0aGlzLl9zeW1ib2xzO1xyXG4gICAgICAgIGZvciAodmFyIHZhbCBpbiBzeW1ib2xzKSB7XHJcbiAgICAgICAgICAgIHZhciBzeW1ib2wgPSBzeW1ib2xzW3ZhbF07XHJcbiAgICAgICAgICAgIGlmIChzeW1ib2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ICAgICAgICB0aGlzLnJlbW92ZUNoaWxkcmVuKCk7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl9zeW1ib2wgPSB0aGlzLl9zeW1ib2xzW2tleWZyYW1lLnJlZl07XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fc3ltYm9sIGluc3RhbmNlb2YgRmx1bXBNb3ZpZV8xLkZsdW1wTW92aWUpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zeW1ib2wucmVzZXQoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuYWRkQ2hpbGQodGhpcy5fc3ltYm9sKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLnNldEtleWZyYW1lRGF0YSh0aGlzLl9zeW1ib2wsIGtleWZyYW1lLCBmcmFtZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLnJlbW92ZUNoaWxkcmVuKCk7XHJcbiAgICAgICAgICAgIHRoaXMuX3N5bWJvbCA9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfTtcclxuICAgIE1vdmllTGF5ZXIucHJvdG90eXBlLnNldEtleWZyYW1lRGF0YSA9IGZ1bmN0aW9uIChzeW1ib2wsIGtleWZyYW1lLCBmcmFtZSkge1xyXG4gICAgICAgIHZhciBzaW5YID0gMC4wO1xyXG4gICAgICAgIHZhciBjb3NYID0gMS4wO1xyXG4gICAgICAgIHZhciBzaW5ZID0gMC4wO1xyXG4gICAgICAgIHZhciBjb3NZID0gMS4wO1xyXG4gICAgICAgIHZhciB4ID0ga2V5ZnJhbWUueDtcclxuICAgICAgICB2YXIgeSA9IGtleWZyYW1lLnk7XHJcbiAgICAgICAgdmFyIHNjYWxlWCA9IGtleWZyYW1lLnNjYWxlWDtcclxuICAgICAgICB2YXIgc2NhbGVZID0ga2V5ZnJhbWUuc2NhbGVZO1xyXG4gICAgICAgIHZhciBza2V3WCA9IGtleWZyYW1lLnNrZXdYO1xyXG4gICAgICAgIHZhciBza2V3WSA9IGtleWZyYW1lLnNrZXdZO1xyXG4gICAgICAgIHZhciBwaXZvdFggPSBrZXlmcmFtZS5waXZvdFg7XHJcbiAgICAgICAgdmFyIHBpdm90WSA9IGtleWZyYW1lLnBpdm90WTtcclxuICAgICAgICB2YXIgYWxwaGEgPSBrZXlmcmFtZS5hbHBoYTtcclxuICAgICAgICB2YXIgZWFzZTtcclxuICAgICAgICB2YXIgaW50ZXJwZWQ7XHJcbiAgICAgICAgdmFyIG5leHRLZXlmcmFtZTtcclxuICAgICAgICBpZiAoa2V5ZnJhbWUuaW5kZXggPCBmcmFtZSAmJiBrZXlmcmFtZS50d2VlbmVkKSB7XHJcbiAgICAgICAgICAgIG5leHRLZXlmcmFtZSA9IHRoaXMuX2xheWVyRGF0YS5nZXRLZXlmcmFtZUFmdGVyKGtleWZyYW1lKTtcclxuICAgICAgICAgICAgaWYgKG5leHRLZXlmcmFtZSBpbnN0YW5jZW9mIEtleWZyYW1lRGF0YV8xLktleWZyYW1lRGF0YSkge1xyXG4gICAgICAgICAgICAgICAgaW50ZXJwZWQgPSAoZnJhbWUgLSBrZXlmcmFtZS5pbmRleCkgLyBrZXlmcmFtZS5kdXJhdGlvbjtcclxuICAgICAgICAgICAgICAgIGVhc2UgPSBrZXlmcmFtZS5lYXNlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGVhc2UgIT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ID0gMC4wO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChlYXNlIDwgMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW52ID0gMSAtIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gMSAtIGludiAqIGludjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzZSA9IDAgLSBlYXNlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGludGVycGVkICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGludGVycGVkID0gZWFzZSAqIHQgKyAoMSAtIGVhc2UpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB4ID0geCArIChuZXh0S2V5ZnJhbWUueCAtIHgpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICB5ID0geSArIChuZXh0S2V5ZnJhbWUueSAtIHkpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICBzY2FsZVggPSBzY2FsZVggKyAobmV4dEtleWZyYW1lLnNjYWxlWCAtIHNjYWxlWCkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIHNjYWxlWSA9IHNjYWxlWSArIChuZXh0S2V5ZnJhbWUuc2NhbGVZIC0gc2NhbGVZKSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgc2tld1ggPSBza2V3WCArIChuZXh0S2V5ZnJhbWUuc2tld1ggLSBza2V3WCkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIHNrZXdZID0gc2tld1kgKyAobmV4dEtleWZyYW1lLnNrZXdZIC0gc2tld1kpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICBhbHBoYSA9IGFscGhhICsgKG5leHRLZXlmcmFtZS5hbHBoYSAtIGFscGhhKSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHN5bWJvbC5zZXRUcmFuc2Zvcm0oeCwgeSwgc2NhbGVYLCBzY2FsZVksIDAsIHNrZXdYLCBza2V3WSwgcGl2b3RYLCBwaXZvdFkpO1xyXG4gICAgICAgIHN5bWJvbC52aXNp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dXJlLnN5bWJvbDtcclxuICAgICAgICAgICAgcmVzdWx0LnB1c2goc3ByaXRlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcclxuICAgIH07XHJcbiAgICByZXR1cm4gVGV4dHVyZUdyb3VwQXRsYXM7XHJcbn0oKSk7XHJcbmV4cG9ydHMuVGV4dHVyZUdyb3VwQXRsYXMgPSBUZXh0dXJlR3JvdXBBdGxhcztcclxuIiwiXCJ1c2Ugc3RyaWN0XCI7XHJcbnZhciBLZXlmcmFtZURhdGEgPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gS2V5ZnJhbWVEYXRhKGpzb24pIHtcclxuICAgICAgICBpZiAoanNvbi5sZW5ndGggIT0gdm9pZCAwKSB7XHJcbiAgICAgICAgICAgIHRoaXMuZnJvbUFycmF5KGpzb24pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdmFyIGpzb25PYmplY3QgPSBqc29uO1xyXG4gICAgICAgICAgICB0aGlzLmluZGV4ID0ganNvbk9iamVjdC5pbmRleDtcclxuICAgICAgICAgICAgdGhpcy5kdXJhdGlvbiA9IGpzb25PYmplY3QuZHVyYXRpb247XHJcbiAgICAgICAgICAgIHRoaXMucmVmID0gJ3JlZicgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QucmVmIDogbnVsbDtcclxuICAgICAgICAgICAgdGhpcy5sYWJlbCA9ICdsYWJlbCcgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QubGFiZWwgOiBudWxsO1xyXG4gICAgICAgICAgICB0aGlzLnggPSAnbG9jJyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5sb2NbMF0gOiAwLjA7XHJcbiAgICAgICAgICAgIHRoaXMueSA9ICdsb2MnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LmxvY1sxXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy5zY2FsZVggPSAnc2NhbGUnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnNjYWxlWzBdIDogMS4wO1xyXG4gICAgICAgICAgICB0aGlzLnNjYWxlWSA9ICdzY2FsZScgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3Quc2NhbGVbMV0gOiAxLjA7XHJcbiAgICAgICAgICAgIHRoaXMuc2tld1ggPSAnc2tldycgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3Quc2tld1swXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy5za2V3WSA9ICdza2V3JyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5za2V3WzFdIDogMC4wO1xyXG4gICAgICAgICAgICB0aGlzLnBpdm90WCA9ICdwaXZvdCcgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QucGl2b3RbMF0gOiAwLjA7XHJcbiAgICAgICAgICAgIHRoaXMucGl2b3RZID0gJ3Bpdm90JyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5waXZvdFsxXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy52aXNpYmxlID0gJ3Zpc2libGUnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnZpc2libGUgOiB0cnVlO1xyXG4gICAgICAgICAgICB0aGlzLmFscGhhID0gJ2FscGhhJyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5hbHBoYSA6IDEuMDtcclxuICAgICAgICAgICAgdGhpcy50d2VlbmVkID0gJ3R3ZWVuZWQnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnR3ZWVuZWQgOiB0cnVlO1xyXG4gICAgICAgICAgICB0aGlzLmVhc2UgPSAnZWFzZScgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QuZWFzZSA6IDAuMDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBLZXlmcmFtZURhdGEucHJvdG90eXBlLmdldFZhbHVlT3JkZXIgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgJ2luZGV4JyxcclxuICAgICAgICAgICAgJ2R1cmF0aW9uJyxcclxuICAgICAgICAgICAgJ3JlZicsXHJcbiAgICAgICAgICAgICdsYWJlbCcsXHJcbiAgICAgICAgICAgICd4JywgJ3knLFxyXG4gICAgICAgICAgICAnc2NhbGVYJywgJ3NjYWxlWScsXHJcbiAgICAgICAgICAgICdza2V3WCcsICdza2V3WScsXHJcbiAgICAgICAgICAgICdwaXZvdFgnLCAncGl2b3RZJyxcclxuICAgICAgICAgICAgJ3Zpc2libGUnLFxyXG4gICAgICAgICAgICAnYWxwaGEnLFxyXG4gICAgICAgICAgICAndHdlZW5lZCcsXHJcbiAgICAgICAgICAgICdlYXNlJ1xyXG4gICAgICAgIF07XHJcbiAgICB9O1xyXG4gICAgS2V5ZnJhbWVEYXRhLnByb3RvdHlwZS50b0FycmF5ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHZhciBvcmRlciA9IHRoaXMuZ2V0VmFsdWVPcmRlcigpO1xyXG4gICAgICAgIHZhciBkYXRhID0gbmV3IEFycmF5KG9yZGVyLmxlbmd0aCk7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvcmRlci5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbmFtZSA9IG9yZGVyW2ldO1xyXG4gICAgICAgICAgICBkYXRhW2ldID0gdGhpc1tuYW1lXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGRhdGE7XHJcbiAgICB9O1xyXG4gICAgS2V5ZnJhbWVEYXRhLnByb3RvdHlwZS5mcm9tQXJyYXkgPSBmdW5jdGlvbiAoZGF0YSkge1xyXG4gICAgICAgIHZhciBvcmRlciA9IHRoaXMuZ2V0VmFsdWVPcmRlcigpO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXI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hdGlvblF1ZXVlLnByb3RvdHlwZS5vblRpY2sgPSBmdW5jdGlvbiAoZGVsdGEpIHtcclxuICAgICAgICB2YXIgdGltZSA9IHRoaXMuX3RpbWUgKz0gZGVsdGE7XHJcbiAgICAgICAgaWYgKCh0aGlzLmN1cnJlbnQgIT0gbnVsbCB8fCB0aGlzLm5leHQoKSAhPSBudWxsKSkge1xyXG4gICAgICAgICAgICB2YXIgY3VycmVudCA9IHRoaXMuY3VycmVudDtcclxuICAgICAgICAgICAgdmFyIGZyb20gPSBjdXJyZW50LmZyb207XHJcbiAgICAgICAgICAgIHZhciBkdXJhdGlvbiA9IGN1cnJlbnQuZHVyYXRpb247XHJcbiAgICAgICAgICAgIHZhciB0aW1lcyA9IGN1cnJlbnQudGltZXM7XHJcbiAgICAgICAgICAgIHZhciBmcmFtZSA9IChkdXJhdGlvbiAqIHRpbWUgLyAoZHVyYXRpb24gKiB0aGlzLl9mcG1zKSk7XHJcbiAgICAgICAgICAgIGlmICh0aW1lcyA+IC0xICYmIHRpbWVzIC0gKGZyYW1lIC8gZHVyYXRpb24pIDwgMCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5uZXh0KCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmZyYW1lID0gZnJvbSArIChmcmFtZSAlIGR1cmF0aW9uKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBBbmltYXRpb25RdWV1ZS5wcm90b3R5cGUuaGFzU3RvcHBlZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gIXRoaXMuY3VycmVudCAmJiAhdGhpcy5oYXNOZXh0KCk7XHJcbiAgICB9O1xyXG4gICAgQW5pbWF0aW9uUXVldWUucHJvdG90eXBlLm5leHQgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgdmFyIG5leHQgPSBfc3VwZXIucHJvdG90e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HJcbiAgICAgICAgICAgIGlmIChhcmdzICYmIChtZXRob2QgPT09ICdQT1NUJyB8fCBtZXRob2QgPT09ICdQVVQnKSkge1xyXG4gICAgICAgICAgICAgICAgdXJpICs9ICc/JztcclxuICAgICAgICAgICAgICAgIHZhciBhcmdjb3VudCA9IDA7XHJcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gYXJncykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChhcmdzLmhhc093blByb3BlcnR5KGtleSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ2NvdW50KyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVyaSArPSAnJic7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgdXJpICs9IGVuY29kZVVSSUNvbXBvbmVudChrZXkpICsgJz0nICsgZW5jb2RlVVJJQ29tcG9uZW50KGFyZ3Nba2V5XSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNsaWVudC5vcGVuKG1ldGhvZCwgdXJpKTtcclxuICAgICAgICAgICAgY2xpZW50LnNlbmQoKTtcclxuICAgICAgICAgICAgY2xpZW50Lm9ubG9hZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnN0YXR1cyA9PT0gMjAwIHx8IHRoaXMuc3RhdHVzID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnJlc3BvbnNlIHx8IHRoaXMucmVzcG9uc2VUZXh0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLnN0YXR1c1RleHQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAg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KCFGdW5jdGlvbi5wcm90b3R5cGUuYmluZCkge1xyXG4gICAgRnVuY3Rpb24ucHJvdG90eXBlLmJpbmQgPSBmdW5jdGlvbiAob1RoaXMpIHtcclxuICAgICAgICBpZiAodHlwZW9mIHRoaXMgIT09ICdmdW5jdGlvbicpIHtcclxuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignRnVuY3Rpb24ucHJvdG90eXBlLmJpbmQgLSB3aGF0IGlzIHRyeWluZyB0byBiZSBib3VuZCBpcyBub3QgY2FsbGFibGUnKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIGFBcmdzID0gQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAxKSwgZlRvQmluZCA9IHRoaXMsIGZOT1AgPSBmdW5jdGlvbiAoKSB7IH0sIGZCb3VuZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGZUb0JpbmQuYXBwbHkodGhpcyBpbnN0YW5jZW9mIGZOT1BcclxuICAgICAgICAgICAgICAgID8gdGhpc1xyXG4gICAgICAgICAgICAgICAgOiBvVGhpcywgYUFyZ3MuY29uY2F0KEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cykpKTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIGlmICh0aGlzLnByb3RvdHlwZSkge1xyXG4gICAgICAgICAgICBmTk9QLnByb3RvdHlwZSA9IHRoaXMucHJvdG90eXBlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBmQm91bmQucHJvdG90eXBlID0gbmV3IGZOT1AoKTtcclxuICAgICAgICByZXR1cm4gZkJvdW5kO1xyXG4gICAgfTtcclxufVxyXG52YXIgaXNBcnJheSA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gKHZhbHVlKSB7IHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwodmFsdWUpID09PSBcIltvYmplY3QgQXJyYXld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Vzb2x2ZSwgcmVqZWN0KSB7XHJcbiAgICB0aGlzLm9uRnVsZmlsbGVkID0gdHlwZW9mIG9uRnVsZmlsbGVkID09PSAnZnVuY3Rpb24nID8gb25GdWxmaWxsZWQgOiBudWxsO1xyXG4gICAgdGhpcy5vblJlamVjdGVkID0gdHlwZW9mIG9uUmVqZWN0ZWQgPT09ICdmdW5jdGlvbicgPyBvblJlamVjdGVkIDogbnVsbDtcclxuICAgIHRoaXMucmVzb2x2ZSA9IHJlc29sdmU7XHJcbiAgICB0aGlzLnJlamVjdCA9IHJlamVjdDtcclxufVxyXG5mdW5jdGlvbiBkb1Jlc29sdmUoZm4sIG9uRnVsZmlsbGVkLCBvblJlamVjdGVkKSB7XHJcbiAgICB2YXIgZG9uZSA9IGZhbHNlO1xyXG4gICAgdHJ5IHtcclxuICAgICAgICBmbihmdW5jdGlvbiAodmFsdWUpIHtcclxuICAgICAgICAgICAgaWYgKGRvbmUpXHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xyXG4gICAgICAgICAgICBvbkZ1bGZpbGxlZCh2YWx1ZSk7XHJcbiAgICAgICAgfSwgZnVuY3Rpb24gKHJlYXNvbikge1xyXG4gICAgICAgICAgICBpZiAoZG9uZSlcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgZG9uZSA9IHRydWU7XHJcbiAgICAgICAgICAgIG9uUmVqZWN0ZWQocmVhc29uKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGNhdGNoIChleCkge1xyXG4gICAgICAgIGlmIChkb25lKVxyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgZG9uZSA9IHRydWU7XHJcbiAgICAgICAgb25SZWplY3RlZChleCk7XHJcbiAgICB9XHJcbn1cclxudmFyIFByb21pc2UgPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gUHJvbWlzZShpbml0KSB7XHJcbiAgICAgICAgdGhpcy5fc3RhdGUgPSBudWxsO1xyXG4gICAgICAgIHRoaXMuX3ZhbHVlID0gbnVsbDtcclxuICAgICAgICB0aGlzLl9kZWZlcnJlZHMgPSBbXTtcclxuICAgICAgICBpZiAodHlwZW9mIHRoaXMgIT09ICdvYmplY3QnKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdQcm9taXNlcyBtdXN0IGJlIGNvbnN0cnVjdGVkIHZpYSBuZXcnKTtcclxuICAgICAgICBpZiAodHlwZW9mIGluaXQgIT09ICdmdW5jdGlvbicpXHJcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ25vdCBhIGZ1bmN0aW9uJyk7XHJcbiAgICAgICAgZG9SZXNvbHZlKGluaXQsIHJlc29sdmUuYmluZCh0aGlzKSwgcmVqZWN0LmJpbmQodGhpcykpO1xyXG4gICAgfVxyXG4gICAgUHJvbWlzZS5hbGwgPSBmdW5jdGlvbiAocHJvbWlzZUxpc3QpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICBpZiAocHJvbWlzZUxpc3QubGVuZ3RoID09PSAwKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoW10pO1xyXG4gICAgICAgICAgICB2YXIgcmVtYWluaW5nID0gcHJvbWlzZUxpc3QubGVuZ3RoO1xyXG4gICAgICAgICAgICBmdW5jdGlvbiByZXMoaSwgdmFsKSB7XHJcbiAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWwgJiYgKHR5cGVvZiB2YWwgPT09ICdvYmplY3QnIHx8IHR5cGVvZiB2YWwgPT09ICdmdW5jdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aGVuID0gdmFsLnRoZW47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhlbiA9PT0gJ2Z1bmN0aW9uJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlbi5jYWxsKHZhbCwgZnVuY3Rpb24gKHZhbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcyhpLCB2YWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcmVqZWN0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBwcm9taXNlTGlzdFtpXSA9IHZhbDtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoLS1yZW1haW5pbmcgPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShwcm9taXNlTGlzdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2F0Y2ggKGV4KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGV4KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHByb21pc2VMaXN0Lmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICByZXMoaSwgcHJvbWlzZUxpc3RbaV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5yZXNvbHZlID0gZnVuY3Rpb24gKHZhbHVlKSB7XHJcbiAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcgJiYgdmFsdWUuY29uc3RydWN0b3IgPT09IFByb21pc2UpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUpIHtcclxuICAgICAgICAgICAgcmVzb2x2ZSh2YWx1ZSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5yZWplY3QgPSBmdW5jdGlvbiAodmFsdWUpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICByZWplY3QodmFsdWUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfTtcclxuICAgIFByb21pc2UucmFjZSA9IGZ1bmN0aW9uICh2YWx1ZXMpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gdmFsdWVzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB2YWx1ZXNbaV0udGhlbihyZXNvbHZlLCByZWplY3QpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5fc2V0SW1tZWRpYXRlRm4gPSBmdW5jdGlvbiAoZm4pIHtcclxuICAgICAgICBhc2FwID0gZm47XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5wcm90b3R5cGUuY2F0Y2ggPSBmdW5jdGlvbiAob25SZWplY3RlZCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLnRoZW4obnVsbCwgb25SZWplY3RlZCk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5wcm90b3R5cGUudGhlbiA9IGZ1bmN0aW9uIChvbkZ1bGZpbGxlZCwgb25SZWplY3RlZCkge1xyXG4gICAgICAgIHZhciBtZSA9IHRoaXM7XHJcbiAgICAgICAgcmV0dXJuIG5ldyBQ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cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBsaXN0W2ldLnRoZW4odGhlbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH07XHJcbiAgICBQcm9taXNlVXRpbC53YWl0Rm9yTG9hZGFibGUgPSBmdW5jdGlvbiAobGlzdCwgb25Qcm9ncmVzcykge1xyXG4gICAgICAgIGlmIChvblByb2dyZXNzID09PSB2b2lkIDApIHsgb25Qcm9ncmVzcyA9IGZ1bmN0aW9uIChwcm9ncmVzcykgeyB9OyB9XHJcbiAgICAgICAgdmFyIGNvdW50ID0gbGlzdC5sZW5ndGg7XHJcbiAgICAgICAgdmFyIHByb2dyZXNzTGlzdCA9IFtdO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY291bnQ7IGkrKykge1xyXG4gICAgICAgICAgICBwcm9ncmVzc0xpc3QucHVzaCgwKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHBydlByb2dyZXNzID0gZnVuY3Rpb24gKGluZGV4LCBwcm9ncmVzcykge1xyXG4gICAgICAgICAgICBwcm9ncmVzc0xpc3RbaW5kZXhdID0gcHJvZ3Jlc3M7XHJcbiAgICAgICAgICAgIHZhciB0b3RhbCA9IDA7XHJcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBwcm9ncmVzc0xpc3QubGVuZ3RoO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB0b3RhbCArPSBwcm9ncmVzc0xpc3RbaV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb25Qcm9ncmVzcyh0b3RhbCAvIGNvdW50KTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHZhciBwcm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ZSB7XHJcbiAgICAgICAgICAgIHRoaXMuY3VycmVudCA9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzLmN1cnJlbnQ7XHJcbiAgICB9O1xyXG4gICAgUXVldWUucHJvdG90eXBlLmhhc05leHQgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuX2xpc3RMZW5ndGggPiAwO1xyXG4gICAgfTtcclxuICAgIFF1ZXVlLnByb3RvdHlwZS5lbmQgPSBmdW5jdGlvbiAoYWxsKSB7XHJcbiAgICAgICAgaWYgKGFsbCA9PT0gdm9pZCAwKSB7IGFsbCA9IGZhbHNlOyB9XHJcbiAgICAgICAgaWYgKGFsbCkge1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0Lmxlbmd0aCA9IDA7XHJcbiAgICAgICAgICAgIHRoaXMuX2xpc3RMZW5ndGggPSAwO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5jdXJyZW50KSB7XHJcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC50aW1lcyA9IDE7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzO1xyXG4gICAgfTtcclxuICAgIFF1ZXVlLnByb3RvdHlwZS5raWxsID0gZnVuY3Rpb24gKGFsbCkge1xyXG4gICAgICAgIGlmIChhbGwgPT09IHZvaWQgMCkgeyBhbGwgPSBmYWxzZTsgfVxyXG4gICAgICAgIGlmIChhbGwpIHtcclxuICAgICAgICAgICAgdGhpcy5fbGlzdC5sZW5ndGggPSAwO1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0TGVuZ3RoID0gMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuY3VycmVudCkge1xyXG4gICAgICAgICAgICB2YXIgY3VycmVudCA9IHRoaXMuY3VycmVudDtcclxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gbnVsbDtcclxuICAgICAgICAgICAgY3VycmVudC5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yXG4gICAgfTtcclxuICAgIFF1ZXVlSXRlbS5wcm90b3R5cGUuZmluaXNoID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmICh0aGlzLl9jb21wbGV0ZSkge1xyXG4gICAgICAgICAgICB0aGlzLl9jb21wbGV0ZS5jYWxsKHRoaXMpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICBRdWV1ZUl0ZW0ucHJvdG90eXBlLmRlc3RydWN0ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHRoaXMubGFiZWwgPSBudWxsO1xyXG4gICAgICAgIHRoaXMuX2NvbXBsZXRlID0gbnVsbDtcclxuICAgIH07XHJcbiAgICByZXR1cm4gUXVldWVJdGVtO1xyXG59KCkpO1xyXG5leHBvcnRzLlF1ZXVlSXRlbSA9IFF1ZXVlSXRlbTtcclxuIl19 //# sourceMappingURL=pixi-flump.js.map diff --git a/bin/pixi-flump.js.map b/bin/pixi-flump.js.map index 0de6bec..fc68a76 100644 --- a/bin/pixi-flump.js.map +++ b/bin/pixi-flump.js.map @@ -1 +1 @@ -{"version":3,"sources":["pixi-flump.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GATA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pixi-flump.js","sourceRoot":"./","sourcesContent":[]} \ No newline at end of file +{"version":3,"sources":["pixi-flump.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GATA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pixi-flump.js","sourceRoot":"./","sourcesContent":[]} \ No newline at end of file diff --git a/bin/pixi-flump.min.js b/bin/pixi-flump.min.js index 2644293..7694cdf 100644 --- a/bin/pixi-flump.min.js +++ b/bin/pixi-flump.min.js @@ -1,2 +1,2 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.PIXI||(e.PIXI={})).FlumpLibrary=t()}}(function(){return function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return n(r?r:t)},h,h.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s-1?o=e.substr(0,e.lastIndexOf("/")):("/"==o.substr(-1)&&(o=o.substr(0,o.length-1)),e+=("/"!=e.substr(e.length-1)?"/":"")+"library.json"),void 0==r?r=new t(o):r.url=o,n.HttpRequest.getJSON(e).then(function(t){return r.processData(t,i)})},t.prototype.hasLoaded=function(){return this._hasLoaded},t.prototype.isLoading=function(){return this._isLoading},t.prototype.load=function(e){if(this.hasLoaded())return e(1),i.Promise.resolve(this);if(!this.url)throw new Error("url is not set and there for can not be loaded");return t.load(this.url,this,e)["catch"](function(){throw new Error("could not load library")})},t.prototype.processData=function(t,e){var r=this;this.md5=t.md5,this.frameRate=t.frameRate,this.referenceList=t.referenceList||null,this.isOptimised=t.optimised||!1;for(var i=[],n=0;na;a++){var u=i[a];o[a]=new s.MovieLayer(a,this,e,u),this.addChild(o[a])}this._movieLayers=o,this.frames=this._movieData.frames,this._frameCallback=new Array(this.frames);for(var a=0;at)for(var i=t;e>i;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r);else if(t>e){for(var i=t;ii;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r)}return this},e.prototype.reset=function(){for(var t=this._movieLayers,e=0;ei){var d=1-n;y=1-d*d,i=0-i}else y=n*n;n=i*y+(1-i)*n}s+=(o.x-s)*n,u+=(o.y-u)*n,l+=(o.scaleX-l)*n,h+=(o.scaleY-h)*n,f+=(o.skewX-f)*n,c+=(o.skewY-c)*n,v+=(o.alpha-v)*n}t.setTransform(s,u,l,h,0,f,c,p,m),t.visible=e.visible,t.alpha=v,this._frame=r},e.prototype.reset=function(){this._symbol instanceof o.FlumpMovie&&this._symbol.reset();for(var t in this._symbols){var e=this._symbols[t];e instanceof o.FlumpMovie&&e.reset()}},e}(PIXI.Container);r.MovieLayer=u},{"../data/KeyframeData":7,"../data/LabelData":8,"./FlumpMovie":2,"./FlumpMtx":3}],5:[function(t,e,r){"use strict";var i=t("./TextureGroupAtlas"),n=t("../util/Promise"),o=function(){function t(t){this.sprites={};for(var e=0;et)return e[r-1];return e[e.length-1]},t.prototype.getKeyframeAfter=function(t){for(var e=0;e-1&&0>o-s/n?this.next():this.frame=i+s%n}},e.prototype.hasStopped=function(){return!this.current&&!this.hasNext()},e.prototype.next=function(){var e=t.prototype.next.call(this);return e&&this.reset(),e},e.prototype.getFrame=function(){return this.frame},e.prototype.reset=function(){this._freeze=!1,this._time=this._time%this._fpms},e}(n.Queue);r.AnimationQueue=o},{"./Queue":16}],13:[function(t,e,r){"use strict";var i=t("../util/Promise"),n=function(){function t(){}return t.request=function(t,e,r){var n=new i.Promise(function(i,n){var o=new XMLHttpRequest,s=e;if(r&&("POST"===t||"PUT"===t)){s+="?";var a=0;for(var u in r)r.hasOwnProperty(u)&&(a++&&(s+="&"),s+=encodeURIComponent(u)+"="+encodeURIComponent(r[u]))}o.open(t,s),o.send(),o.onload=function(){200===this.status||0===this.status?i(this.response||this.responseText):n(this.statusText)},o.onerror=function(){n(this.statusText)}});return n},t.getString=function(e,r){return void 0===r&&(r={}),t.request("GET",e,r)},t.getJSON=function(e,r){return void 0===r&&(r={}),t.getString(e,r).then(function(t){return JSON.parse(t)})},t}();r.HttpRequest=n},{"../util/Promise":14}],14:[function(t,e,r){"use strict";function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return void(e._state?t.resolve:t.reject)(e._value);var i;try{i=r(e._value)}catch(n){return void t.reject(n)}t.resolve(i)})}function n(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void u(e.bind(t),n.bind(this),o.bind(this))}this._state=!0,this._value=t,s.call(this)}catch(r){o.call(this,r)}}function o(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=i}function u(t,e,r){var i=!1;try{t(function(t){i||(i=!0,e(t))},function(t){i||(i=!0,r(t))})}catch(n){if(i)return;i=!0,r(n)}}var l="function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,i=function(){},n=function(){return r.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),n.prototype=new i,n});var h=(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},function(){function t(t){if(this._state=null,this._value=null,this._deferreds=[],"object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");u(t,n.bind(this),o.bind(this))}return t.all=function(e){return new t(function(t,r){function i(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(o,t)},r)}e[o]=s,0===--n&&t(e)}catch(u){r(u)}}if(0===e.length)return t([]);for(var n=e.length,o=0;oi;i++)e[i].then(t,r)})},t._setImmediateFn=function(t){l=t},t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(e,r){var n=this;return new t(function(t,o){i.call(n,new a(e,r,t,o))})},t}());r.Promise=h},{}],15:[function(t,e,r){"use strict";var i=t("./Promise"),n=function(){function t(){}return t.wait=function(t,e){return void 0===e&&(e=function(t){}),new i.Promise(function(r){for(var i=[],n=function(n){i.push(n),e(i.length/t.length),i.length==t.length&&r(i)},o=0;oo;o++)n.push(0);for(var s=function(t,e){n[t]=e;for(var o=0,s=n.length,a=0;s>a;a++)o+=n[a];r(o/i)},a=new Array(i),o=0;i>o;o++)a[o]=e[o].load(s.bind(this,o));return t.wait(a)},t}();r.PromiseUtil=n},{"./Promise":14}],16:[function(t,e,r){"use strict";var i=function(){function t(){this._list=[],this._listLength=0,this.current=null}return t.prototype.add=function(t){return this._list.push(t),this._listLength++,this},t.prototype.next=function(){return this.kill(),this._listLength>0?(this.current=this._list.shift(),this._listLength--):this.current=null,this.current},t.prototype.hasNext=function(){return this._listLength>0},t.prototype.end=function(t){return void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current&&(this.current.times=1),this},t.prototype.kill=function(t){if(void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current){var e=this.current;this.current=null,e.finish(),e.destruct()}return this},t}();r.Queue=i},{}],17:[function(t,e,r){"use strict";var i=function(){function t(t,e,r,i,n){if(void 0===i&&(i=1),void 0===n&&(n=0),this._complete=null,e>r)throw new Error('argument "from" cannot be bigger than argument "to"');this.label=t,this.from=e,this.to=r,this.duration=r-e,this.times=i,this.delay=n}return t.prototype.then=function(t){return this._complete=t,this},t.prototype.finish=function(){return this._complete&&this._complete.call(this),this},t.prototype.destruct=function(){this.label=null,this._complete=null},t}();r.QueueItem=i},{}]},{},[11])(11)}); +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.PIXI||(e.PIXI={})).FlumpLibrary=t()}}(function(){return function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return n(r?r:t)},h,h.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s-1?o=e.substr(0,e.lastIndexOf("/")):("/"==o.substr(-1)&&(o=o.substr(0,o.length-1)),e+=("/"!=e.substr(e.length-1)?"/":"")+"library.json"),void 0==r?r=new t(o):r.url=o,n.HttpRequest.getJSON(e).then(function(t){return r.processData(t,i)})},t.prototype.hasLoaded=function(){return this._hasLoaded},t.prototype.isLoading=function(){return this._isLoading},t.prototype.load=function(e){if(this.hasLoaded())return e(1),i.Promise.resolve(this);if(!this.url)throw new Error("url is not set and there for can not be loaded");return t.load(this.url,this,e)["catch"](function(){throw new Error("could not load library")})},t.prototype.processData=function(t,e){var r=this;this.md5=t.md5,this.frameRate=t.frameRate,this.referenceList=t.referenceList||null,this.isOptimised=t.optimised||!1;for(var i=[],n=0;na;a++){var u=i[a];o[a]=new s.MovieLayer(a,this,e,u),this.addChild(o[a])}this._movieLayers=o,this.frames=this._movieData.frames,this._frameCallback=new Array(this.frames);for(var a=0;at)for(var i=t;e>i;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r);else if(t>e){for(var i=t;ii;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r)}return this},e.prototype.reset=function(){for(var t=this._movieLayers,e=0;ei){var d=1-n;y=1-d*d,i=0-i}else y=n*n;n=i*y+(1-i)*n}s+=(o.x-s)*n,u+=(o.y-u)*n,l+=(o.scaleX-l)*n,h+=(o.scaleY-h)*n,f+=(o.skewX-f)*n,c+=(o.skewY-c)*n,v+=(o.alpha-v)*n}t.setTransform(s,u,l,h,0,f,c,p,m),t.visible=e.visible,t.alpha=v,this._frame=r},e.prototype.reset=function(){this._symbol instanceof o.FlumpMovie&&this._symbol.reset();for(var t in this._symbols){var e=this._symbols[t];e instanceof o.FlumpMovie&&e.reset()}},e}(PIXI.Container);r.MovieLayer=u},{"../data/KeyframeData":7,"../data/LabelData":8,"./FlumpMovie":2,"./FlumpMtx":3}],5:[function(t,e,r){"use strict";var i=t("./TextureGroupAtlas"),n=t("../util/Promise"),o=function(){function t(t){this.sprites={};for(var e=0;et)return e[r-1];return e[e.length-1]},t.prototype.getKeyframeAfter=function(t){for(var e=0;e-1&&0>o-s/n?this.next():this.frame=i+s%n}},e.prototype.hasStopped=function(){return!this.current&&!this.hasNext()},e.prototype.next=function(){var e=t.prototype.next.call(this);return e&&this.reset(),e},e.prototype.getFrame=function(){return this.frame},e.prototype.reset=function(){this._freeze=!1,this._time=this._time%this._fpms},e}(n.Queue);r.AnimationQueue=o},{"./Queue":16}],13:[function(t,e,r){"use strict";var i=t("../util/Promise"),n=function(){function t(){}return t.request=function(t,e,r){var n=new i.Promise(function(i,n){var o=new XMLHttpRequest,s=e;if(r&&("POST"===t||"PUT"===t)){s+="?";var a=0;for(var u in r)r.hasOwnProperty(u)&&(a++&&(s+="&"),s+=encodeURIComponent(u)+"="+encodeURIComponent(r[u]))}o.open(t,s),o.send(),o.onload=function(){200===this.status||0===this.status?i(this.response||this.responseText):n(this.statusText)},o.onerror=function(){n(this.statusText)}});return n},t.getString=function(e,r){return void 0===r&&(r={}),t.request("GET",e,r)},t.getJSON=function(e,r){return void 0===r&&(r={}),t.getString(e,r).then(function(t){return JSON.parse(t)})},t}();r.HttpRequest=n},{"../util/Promise":14}],14:[function(t,e,r){"use strict";function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return void(e._state?t.resolve:t.reject)(e._value);var i;try{i=r(e._value)}catch(n){return void t.reject(n)}t.resolve(i)})}function n(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void u(e.bind(t),n.bind(this),o.bind(this))}this._state=!0,this._value=t,s.call(this)}catch(r){o.call(this,r)}}function o(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=i}function u(t,e,r){var i=!1;try{t(function(t){i||(i=!0,e(t))},function(t){i||(i=!0,r(t))})}catch(n){if(i)return;i=!0,r(n)}}var l="function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,i=function(){},n=function(){return r.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),n.prototype=new i,n});var h=(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},function(){function t(t){if(this._state=null,this._value=null,this._deferreds=[],"object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");u(t,n.bind(this),o.bind(this))}return t.all=function(e){return new t(function(t,r){function i(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(o,t)},r)}e[o]=s,0===--n&&t(e)}catch(u){r(u)}}if(0===e.length)return t([]);for(var n=e.length,o=0;oi;i++)e[i].then(t,r)})},t._setImmediateFn=function(t){l=t},t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(e,r){var n=this;return new t(function(t,o){i.call(n,new a(e,r,t,o))})},t}());r.Promise=h},{}],15:[function(t,e,r){"use strict";var i=t("./Promise"),n=function(){function t(){}return t.wait=function(t,e){return void 0===e&&(e=function(t){}),new i.Promise(function(r){for(var i=[],n=function(n){i.push(n),e(i.length/t.length),i.length==t.length&&r(i)},o=0;oo;o++)n.push(0);for(var s=function(t,e){n[t]=e;for(var o=0,s=n.length,a=0;s>a;a++)o+=n[a];r(o/i)},a=new Array(i),o=0;i>o;o++)a[o]=e[o].load(s.bind(this,o));return t.wait(a)},t}();r.PromiseUtil=n},{"./Promise":14}],16:[function(t,e,r){"use strict";var i=function(){function t(){this._list=[],this._listLength=0,this.current=null}return t.prototype.add=function(t){return this._list.push(t),this._listLength++,this},t.prototype.next=function(){return this.kill(),this._listLength>0?(this.current=this._list.shift(),this._listLength--):this.current=null,this.current},t.prototype.hasNext=function(){return this._listLength>0},t.prototype.end=function(t){return void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current&&(this.current.times=1),this},t.prototype.kill=function(t){if(void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current){var e=this.current;this.current=null,e.finish(),e.destruct()}return this},t}();r.Queue=i},{}],17:[function(t,e,r){"use strict";var i=function(){function t(t,e,r,i,n){if(void 0===i&&(i=1),void 0===n&&(n=0),this._complete=null,e>r)throw new Error('argument "from" cannot be bigger than argument "to"');this.label=t,this.from=e,this.to=r,this.duration=r-e,this.times=i,this.delay=n}return t.prototype.then=function(t){return this._complete=t,this},t.prototype.finish=function(){return this._complete&&this._complete.call(this),this},t.prototype.destruct=function(){this.label=null,this._complete=null},t}();r.QueueItem=i},{}]},{},[11])(11)}); //# sourceMappingURL=pixi-flump.min.js.map diff --git a/bin/pixi-flump.min.js.map b/bin/pixi-flump.min.js.map index 43208ad..98d1540 100644 --- a/bin/pixi-flump.min.js.map +++ b/bin/pixi-flump.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["pixi-flump.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","PIXI","FlumpLibrary","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","Promise_1","HttpRequest_1","PromiseUtil_1","TextureGroup_1","FlumpMovie_1","MovieData_1","QueueItem_1","basePath","movieData","textureGroups","fps","isOptimised","_hasLoaded","_isLoading","url","load","library","onProcess","baseDir","indexOf","substr","lastIndexOf","HttpRequest","getJSON","then","json","processData","prototype","hasLoaded","isLoading","onProgress","Promise","resolve","_this","md5","frameRate","referenceList","optimised","textureGroupLoaders","movies","MovieData","push","textureGroup","promise","TextureGroup","PromiseUtil","wait","getMovieData","name","id","createSymbol","paused","textures","sprites","movie","FlumpMovie","getQueue","add","QueueItem","frames","console","warn","createMovie","getNameFromReferenceList","value","EVENT_LOAD","./core/FlumpMovie","./core/TextureGroup","./data/MovieData","./util/HttpRequest","./util/Promise","./util/PromiseUtil","./util/QueueItem","2","__extends","d","b","__","constructor","p","hasOwnProperty","Object","create","AnimationQueue_1","MovieLayer_1","_super","_labels","_queue","hasFrameCallbacks","frame","speed","_library","_movieData","layers","layerData","movieLayers","Array","MovieLayer","addChild","_movieLayers","_frameCallback","setLabel","data","AnimationQueue","play","times","label","complete","visible","queue","queueLabel","index","duration","resume","pause","end","all","stop","kill","next","setFrameCallback","frameNumber","callback","triggerOnce","delta","gotoAndStop","frameOrLabel","onTick","accumulated","newFrame","getFrame","layer","setFrame","getSymbol","symbol","replaceSymbol","handleFrameCallback","fromFrame","toFrame","reset","Container","../core/MovieLayer","../util/AnimationQueue","../util/QueueItem","3","FlumpMtx","c","tx","ty","4","FlumpMtx_1","LabelData_1","KeyframeData_1","_frame","_symbols","enabled","_storedMtx","keyframeData","_index","_movie","_layerData","keyframe","LabelData","ref","symbols","val","item","_symbol","getKeyframeForFrame","Math","floor","removeChild","setKeyframeData","ease","interped","nextKeyframe","x","y","scaleX","scaleY","skewX","skewY","pivotX","pivotY","alpha","tweened","getKeyframeAfter","KeyframeData","inv","setTransform","../data/KeyframeData","../data/LabelData","./FlumpMovie","./FlumpMtx","5","TextureGroupAtlas_1","sprite","atlases","loaders","atlas","TextureGroupAtlas","result","concat","getSprites","err","../util/Promise","./TextureGroupAtlas","6","Texture","BaseTexture","Rectangle","renderTexture","_renderTexture","_atlas","file","reject","img","document","createElement","onload","onerror","src","baseTexture","texture","Sprite","rect","7","fromArray","jsonObject","loc","scale","skew","pivot","getValueOrder","toArray","order","8","9","LayerData","flipbook","keyframes","keyFrameData","datas","flumpKeyframeData","./KeyframeData","10","LayerData_1","max","./LayerData","11","FlumpLibrary_1","./FlumpLibrary","12","Queue_1","unit","_freeze","_hasStopped","_time","_fpms","time","current","from","hasStopped","hasNext","Queue","./Queue","13","request","method","args","client","XMLHttpRequest","uri","argcount","key","encodeURIComponent","open","send","status","response","responseText","statusText","getString","query","JSON","parse","14","handle","deferred","me","_state","_deferreds","asap","cb","onFulfilled","onRejected","_value","ret","newValue","TypeError","doResolve","bind","finale","len","Handler","fn","done","reason","ex","setImmediate","setTimeout","Function","oThis","aArgs","slice","arguments","fToBind","fNOP","fBound","apply","isArray","toString","init","promiseList","res","remaining","race","values","_setImmediateFn","15","list","progress","newList","waitForLoadable","count","progressList","prvProgress","total","./Promise","16","_list","_listLength","shift","finish","destruct","17","to","delay","_complete"],"mappings":"CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,MAAAJ,EAAAK,OAAAL,EAAAK,UAAAC,aAAAX,MAAA,WAAA,MAAA,SAAAY,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAjB,GAAA,GAAAsB,OAAA,uBAAAL,EAAA,IAAA,MAAAjB,GAAAuB,KAAA,mBAAAvB,EAAA,GAAAwB,GAAAV,EAAAG,IAAAhB,WAAAY,GAAAI,GAAA,GAAAQ,KAAAD,EAAAvB,QAAA,SAAAW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b,MAAA6H,MAAAA,EACA7H,KAAAwR,KAAAA,EACAxR,KAAA6W,GAAAA,EACA7W,KAAAmI,SAAA0O,EAAArF,EACAxR,KAAA4H,MAAAA,EACA5H,KAAA8W,MAAAA,EAgBA,MAdAjS,GAAA/B,UAAAH,KAAA,SAAAmF,GAEA,MADA9H,MAAA+W,UAAAjP,EACA9H,MAEA6E,EAAA/B,UAAA4T,OAAA,WAIA,MAHA1W,MAAA+W,WACA/W,KAAA+W,UAAA/V,KAAAhB,MAEAA,MAEA6E,EAAA/B,UAAA6T,SAAA,WACA3W,KAAA6H,MAAA,KACA7H,KAAA+W,UAAA,MAEAlS,IAEArF,GAAAqF,UAAAA,YAEA,KAAA","file":"pixi-flump.min.js","sourcesContent":[null],"sourceRoot":"./"} \ No newline at end of file +{"version":3,"sources":["pixi-flump.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","PIXI","FlumpLibrary","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","Promise_1","HttpRequest_1","PromiseUtil_1","TextureGroup_1","FlumpMovie_1","MovieData_1","QueueItem_1","basePath","movieData","textureGroups","fps","isOptimised","_hasLoaded","_isLoading","url","load","library","onProcess","baseDir","indexOf","substr","lastIndexOf","HttpRequest","getJSON","then","json","processData","prototype","hasLoaded","isLoading","onProgress","Promise","resolve","_this","md5","frameRate","referenceList","optimised","textureGroupLoaders","movies","MovieData","push","textureGroup","promise","TextureGroup","PromiseUtil","wait","getMovieData","name","id","createSymbol","paused","textures","sprites","movie","FlumpMovie","getQueue","add","QueueItem","frames","console","warn","createMovie","getNameFromReferenceList","value","EVENT_LOAD","./core/FlumpMovie","./core/TextureGroup","./data/MovieData","./util/HttpRequest","./util/Promise","./util/PromiseUtil","./util/QueueItem","2","__extends","d","b","__","constructor","p","hasOwnProperty","Object","create","AnimationQueue_1","MovieLayer_1","_super","_labels","_queue","hasFrameCallbacks","frame","speed","_library","_movieData","layers","layerData","movieLayers","Array","MovieLayer","addChild","_movieLayers","_frameCallback","setLabel","data","AnimationQueue","play","times","label","complete","visible","queue","queueLabel","index","duration","resume","pause","end","all","stop","kill","next","setFrameCallback","frameNumber","callback","triggerOnce","delta","gotoAndStop","frameOrLabel","onTick","accumulated","newFrame","getFrame","layer","setFrame","getSymbol","symbol","replaceSymbol","handleFrameCallback","fromFrame","toFrame","reset","Container","../core/MovieLayer","../util/AnimationQueue","../util/QueueItem","3","FlumpMtx","c","tx","ty","4","FlumpMtx_1","LabelData_1","KeyframeData_1","_frame","_symbols","enabled","_storedMtx","keyframeData","_index","_movie","_layerData","keyframe","LabelData","ref","symbols","val","item","_symbol","getKeyframeForFrame","Math","floor","removeChildren","setKeyframeData","ease","interped","nextKeyframe","x","y","scaleX","scaleY","skewX","skewY","pivotX","pivotY","alpha","tweened","getKeyframeAfter","KeyframeData","inv","setTransform","../data/KeyframeData","../data/LabelData","./FlumpMovie","./FlumpMtx","5","TextureGroupAtlas_1","sprite","atlases","loaders","atlas","TextureGroupAtlas","result","concat","getSprites","err","../util/Promise","./TextureGroupAtlas","6","Texture","BaseTexture","Rectangle","renderTexture","_renderTexture","_atlas","file","reject","img","document","createElement","onload","onerror","src","baseTexture","texture","Sprite","rect","7","fromArray","jsonObject","loc","scale","skew","pivot","getValueOrder","toArray","order","8","9","LayerData","flipbook","keyframes","keyFrameData","datas","flumpKeyframeData","./KeyframeData","10","LayerData_1","max","./LayerData","11","FlumpLibrary_1","./FlumpLibrary","12","Queue_1","unit","_freeze","_hasStopped","_time","_fpms","time","current","from","hasStopped","hasNext","Queue","./Queue","13","request","method","args","client","XMLHttpRequest","uri","argcount","key","encodeURIComponent","open","send","status","response","responseText","statusText","getString","query","JSON","parse","14","handle","deferred","me","_state","_deferreds","asap","cb","onFulfilled","onRejected","_value","ret","newValue","TypeError","doResolve","bind","finale","len","Handler","fn","done","reason","ex","setImmediate","setTimeout","Function","oThis","aArgs","slice","arguments","fToBind","fNOP","fBound","apply","isArray","toString","init","promiseList","res","remaining","race","values","_setImmediateFn","15","list","progress","newList","waitForLoadable","count","progressList","prvProgress","total","./Promise","16","_list","_listLength","shift","finish","destruct","17","to","delay","_complete"],"mappings":"CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,MAAAJ,EAAAK,OAAAL,EAAAK,UAAAC,aAAAX,MAAA,WAAA,MAAA,SAAAY,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAjB,GAAA,GAAAsB,OAAA,uBAAAL,EAAA,IAAA,MAAAjB,GAAAuB,KAAA,mBAAAvB,EAAA,GAAAwB,GAAAV,EAAAG,IAAAhB,WAAAY,GAAAI,GAAA,GAAAQ,KAAAD,EAAAvB,QAAA,SAAAW,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAY,EAAAA,EAAAvB,QAAAW,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAhB,QAAA,IAAA,GAAAoB,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAW,OAAAT,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,KAAAW,GAAA,SAAAP,EAAAlB,EAAAD,GACA,YACA,IAAA2B,GAAAR,EAAA,kBACAS,EAAAT,EAAA,sBACAU,EAAAV,EAAA,sBACAW,EAAAX,EAAA,uBACAY,EAAAZ,EAAA,qBACAa,EAAAb,EAAA,oB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],"sourceRoot":"./"} \ No newline at end of file diff --git a/src/core/MovieLayer.js b/src/core/MovieLayer.js index 2957411..d16aca4 100644 --- a/src/core/MovieLayer.js +++ b/src/core/MovieLayer.js @@ -74,16 +74,17 @@ var MovieLayer = (function (_super) { var keyframe = this._layerData.getKeyframeForFrame(Math.floor(frame)); if (keyframe.ref != -1 && keyframe.ref != null) { if (this._symbol != this._symbols[keyframe.ref]) { - this._movie.removeChild(this._symbol); + this.removeChildren(); this._symbol = this._symbols[keyframe.ref]; if (this._symbol instanceof FlumpMovie_1.FlumpMovie) { this._symbol.reset(); } - this._movie.addChild(this._symbol); + this.addChild(this._symbol); } this.setKeyframeData(this._symbol, keyframe, frame); } else { + this.removeChildren(); this._symbol = null; } return true; diff --git a/src/core/MovieLayer.ts b/src/core/MovieLayer.ts index dcfa0e1..b3467ba 100644 --- a/src/core/MovieLayer.ts +++ b/src/core/MovieLayer.ts @@ -27,7 +27,7 @@ export class MovieLayer extends PIXI.Container constructor(index:number, movie:FlumpMovie, library:FlumpLibrary, layerData:LayerData) { super(); - + var keyframeData = layerData.keyframeData; this._index = index; @@ -120,7 +120,7 @@ export class MovieLayer extends PIXI.Container { if(this._symbol != this._symbols[keyframe.ref]) { - this._movie.removeChild(this._symbol); + this.removeChildren(); this._symbol = this._symbols[keyframe.ref]; @@ -129,13 +129,14 @@ export class MovieLayer extends PIXI.Container ( this._symbol).reset(); } - this._movie.addChild(this._symbol); + this.addChild(this._symbol); } this.setKeyframeData(this._symbol, keyframe, frame); } else { + this.removeChildren(); this._symbol = null; } @@ -197,9 +198,9 @@ export class MovieLayer extends PIXI.Container } } - symbol.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, pivotX, pivotY) - symbol.visible = keyframe.visible; - symbol.alpha = alpha; + this.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, pivotX, pivotY) + this.visible = keyframe.visible; + this.alpha = alpha; // if(skewX != 0) // {