Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phaser-ui-comps

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phaser-ui-comps - npm Package Compare versions

Comparing version 0.1.3 to 1.0.0

2

dist/phaser-ui-comps-with-underscore.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser")):"function"==typeof define&&define.amd?define(["phaser"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser")):t.PhaserComps=e(t.Phaser)}(window,function(t){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,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=10)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=o(n(2));o(n(1));function o(t){return t&&t.__esModule?t:{default:t}}var u="event_state",a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.lockId=null,r._parent=t,r._key=n,r._clip=null,r._texts={},n&&t&&t.on(u,r._onEventState,r),r._clipUpdate(),r}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,i.default.Events.EventEmitter),r(e,null,[{key:"EVENT_STATE",get:function(){return u}}]),r(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(u,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(u)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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}}();var i=!1,o=[],u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"lock",value:function(t){this.unlock(),"string"==typeof t?o.push(t):t.forEach(function(t){return o.push(t)}),i=!0}},{key:"unlock",value:function(){o.length=0,i=!1}},{key:"check",value:function(t){return!i||-1!==o.indexOf(t)}}]),t}();e.default=u},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(0)),o=u(n(1));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._enable=!0,i._isPressed=!1,i._isOver=!1,r&&(i.label=r),i}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,i.default),r(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),r(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&o.default.check(this.lockId)&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=a},function(t,e,n){(function(t,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,u=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,s=u.push,c=u.slice,f=a.toString,p=a.hasOwnProperty,h=Array.isArray,_=Object.keys,v=Object.create,y=function(){},d=function(t){return t instanceof d?t:this instanceof d?void(this._wrapped=t):new d(t)};e.nodeType?i._=d:(!n.nodeType&&n.exports&&(e=n.exports=d),e._=d),d.VERSION="1.9.1";var g,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},m=function(t,e,n){return d.iteratee!==g?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?b(t,e,n):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)};d.iteratee=g=function(t,e){return m(t,e,1/0)};var O=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}},k=function(t){if(!d.isObject(t))return{};if(v)return v(t);y.prototype=t;var e=new y;return y.prototype=null,e},C=function(t){return function(e){return null==e?void 0:e[t]}},w=function(t,e){return null!=t&&p.call(t,e)},P=function(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0},j=Math.pow(2,53)-1,S=C("length"),x=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=j};d.each=d.forEach=function(t,e,n){var r,i;if(e=b(e,n),x(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=d.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},d.map=d.collect=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=Array(i),u=0;u<i;u++){var a=r?r[u]:u;o[u]=e(t[a],a,t)}return o};var I=function(t){return function(e,n,r,i){var o=arguments.length>=3;return function(e,n,r,i){var o=!x(e)&&d.keys(e),u=(o||e).length,a=t>0?0:u-1;for(i||(r=e[o?o[a]:a],a+=t);a>=0&&a<u;a+=t){var l=o?o[a]:a;r=n(r,e[l],l,e)}return r}(e,b(n,i,4),r,o)}};d.reduce=d.foldl=d.inject=I(1),d.reduceRight=d.foldr=I(-1),d.find=d.detect=function(t,e,n){var r=(x(t)?d.findIndex:d.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},d.filter=d.select=function(t,e,n){var r=[];return e=m(e,n),d.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},d.reject=function(t,e,n){return d.filter(t,d.negate(m(e)),n)},d.every=d.all=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(!e(t[u],u,t))return!1}return!0},d.some=d.any=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(e(t[u],u,t))return!0}return!1},d.contains=d.includes=d.include=function(t,e,n,r){return x(t)||(t=d.values(t)),("number"!=typeof n||r)&&(n=0),d.indexOf(t,e,n)>=0},d.invoke=O(function(t,e,n){var r,i;return d.isFunction(e)?i=e:d.isArray(e)&&(r=e.slice(0,-1),e=e[e.length-1]),d.map(t,function(t){var o=i;if(!o){if(r&&r.length&&(t=P(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),d.pluck=function(t,e){return d.map(t,d.property(e))},d.where=function(t,e){return d.filter(t,d.matcher(e))},d.findWhere=function(t,e){return d.find(t,d.matcher(e))},d.max=function(t,e,n){var r,i,o=-1/0,u=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=x(t)?t:d.values(t)).length;a<l;a++)null!=(r=t[a])&&r>o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))>u||i===-1/0&&o===-1/0)&&(o=t,u=i)});return o},d.min=function(t,e,n){var r,i,o=1/0,u=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=x(t)?t:d.values(t)).length;a<l;a++)null!=(r=t[a])&&r<o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))<u||i===1/0&&o===1/0)&&(o=t,u=i)});return o},d.shuffle=function(t){return d.sample(t,1/0)},d.sample=function(t,e,n){if(null==e||n)return x(t)||(t=d.values(t)),t[d.random(t.length-1)];var r=x(t)?d.clone(t):d.values(t),i=S(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,u=0;u<e;u++){var a=d.random(u,o),l=r[u];r[u]=r[a],r[a]=l}return r.slice(0,e)},d.sortBy=function(t,e,n){var r=0;return e=m(e,n),d.pluck(d.map(t,function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var E=function(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=m(r,i),d.each(n,function(e,i){var u=r(e,i,n);t(o,e,u)}),o}};d.groupBy=E(function(t,e,n){w(t,n)?t[n].push(e):t[n]=[e]}),d.indexBy=E(function(t,e,n){t[n]=e}),d.countBy=E(function(t,e,n){w(t,n)?t[n]++:t[n]=1});var T=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(t){return t?d.isArray(t)?c.call(t):d.isString(t)?t.match(T):x(t)?d.map(t,d.identity):d.values(t):[]},d.size=function(t){return null==t?0:x(t)?t.length:d.keys(t).length},d.partition=E(function(t,e,n){t[n?0:1].push(e)},!0),d.first=d.head=d.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:d.initial(t,t.length-e)},d.initial=function(t,e,n){return c.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},d.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:d.rest(t,Math.max(0,t.length-e))},d.rest=d.tail=d.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},d.compact=function(t){return d.filter(t,Boolean)};var A=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,u=S(t);o<u;o++){var a=t[o];if(x(a)&&(d.isArray(a)||d.isArguments(a)))if(e)for(var l=0,s=a.length;l<s;)r[i++]=a[l++];else A(a,e,n,r),i=r.length;else n||(r[i++]=a)}return r};d.flatten=function(t,e){return A(t,e,!1)},d.without=O(function(t,e){return d.difference(t,e)}),d.uniq=d.unique=function(t,e,n,r){d.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=m(n,r));for(var i=[],o=[],u=0,a=S(t);u<a;u++){var l=t[u],s=n?n(l,u,t):l;e&&!n?(u&&o===s||i.push(l),o=s):n?d.contains(o,s)||(o.push(s),i.push(l)):d.contains(i,l)||i.push(l)}return i},d.union=O(function(t){return d.uniq(A(t,!0,!0))}),d.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=S(t);r<i;r++){var o=t[r];if(!d.contains(e,o)){var u;for(u=1;u<n&&d.contains(arguments[u],o);u++);u===n&&e.push(o)}}return e},d.difference=O(function(t,e){return e=A(e,!0,!0),d.filter(t,function(t){return!d.contains(e,t)})}),d.unzip=function(t){for(var e=t&&d.max(t,S).length||0,n=Array(e),r=0;r<e;r++)n[r]=d.pluck(t,r);return n},d.zip=O(d.unzip),d.object=function(t,e){for(var n={},r=0,i=S(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};var M=function(t){return function(e,n,r){n=m(n,r);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}};d.findIndex=M(1),d.findLastIndex=M(-1),d.sortedIndex=function(t,e,n,r){for(var i=(n=m(n,r,1))(e),o=0,u=S(t);o<u;){var a=Math.floor((o+u)/2);n(t[a])<i?o=a+1:u=a}return o};var B=function(t,e,n){return function(r,i,o){var u=0,a=S(r);if("number"==typeof o)t>0?u=o>=0?o:Math.max(o+a,u):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(c.call(r,u,a),d.isNaN))>=0?o+u:-1;for(o=t>0?u:a-1;o>=0&&o<a;o+=t)if(r[o]===i)return o;return-1}};d.indexOf=B(1,d.findIndex,d.sortedIndex),d.lastIndexOf=B(-1,d.findLastIndex),d.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},d.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(c.call(t,r,r+=e));return n};var F=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=k(t.prototype),u=t.apply(o,i);return d.isObject(u)?u:o};d.bind=O(function(t,e,n){if(!d.isFunction(t))throw new TypeError("Bind must be called on a function");var r=O(function(i){return F(t,r,e,this,n.concat(i))});return r}),d.partial=O(function(t,e){var n=d.partial.placeholder,r=function(){for(var i=0,o=e.length,u=Array(o),a=0;a<o;a++)u[a]=e[a]===n?arguments[i++]:e[a];for(;i<arguments.length;)u.push(arguments[i++]);return F(t,r,this,this,u)};return r}),d.partial.placeholder=d,d.bindAll=O(function(t,e){var n=(e=A(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=d.bind(t[r],t)}}),d.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return w(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},d.delay=O(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(t,e,n){var r,i,o,u,a=0;n||(n={});var l=function(){a=!1===n.leading?0:d.now(),r=null,u=t.apply(i,o),r||(i=o=null)},s=function(){var s=d.now();a||!1!==n.leading||(a=s);var c=e-(s-a);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),a=s,u=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),u};return s.cancel=function(){clearTimeout(r),a=0,r=i=o=null},s},d.debounce=function(t,e,n){var r,i,o=function(e,n){r=null,n&&(i=t.apply(e,n))},u=O(function(u){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,e),a&&(i=t.apply(this,u))}else r=d.delay(o,e,this,u);return i});return u.cancel=function(){clearTimeout(r),r=null},u},d.wrap=function(t,e){return d.partial(e,t)},d.negate=function(t){return function(){return!t.apply(this,arguments)}},d.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},d.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},d.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},d.once=d.partial(d.before,2),d.restArguments=O;var V=!{toString:null}.propertyIsEnumerable("toString"),D=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],N=function(t,e){var n=D.length,r=t.constructor,i=d.isFunction(r)&&r.prototype||a,o="constructor";for(w(t,o)&&!d.contains(e,o)&&e.push(o);n--;)(o=D[n])in t&&t[o]!==i[o]&&!d.contains(e,o)&&e.push(o)};d.keys=function(t){if(!d.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)w(t,n)&&e.push(n);return V&&N(t,e),e},d.allKeys=function(t){if(!d.isObject(t))return[];var e=[];for(var n in t)e.push(n);return V&&N(t,e),e},d.values=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},d.mapObject=function(t,e,n){e=m(e,n);for(var r=d.keys(t),i=r.length,o={},u=0;u<i;u++){var a=r[u];o[a]=e(t[a],a,t)}return o},d.pairs=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},d.invert=function(t){for(var e={},n=d.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},d.functions=d.methods=function(t){var e=[];for(var n in t)d.isFunction(t[n])&&e.push(n);return e.sort()};var X=function(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],u=t(o),a=u.length,l=0;l<a;l++){var s=u[l];e&&void 0!==n[s]||(n[s]=o[s])}return n}};d.extend=X(d.allKeys),d.extendOwn=d.assign=X(d.keys),d.findKey=function(t,e,n){e=m(e,n);for(var r,i=d.keys(t),o=0,u=i.length;o<u;o++)if(e(t[r=i[o]],r,t))return r};var Y,L,U=function(t,e,n){return e in n};d.pick=O(function(t,e){var n={},r=e[0];if(null==t)return n;d.isFunction(r)?(e.length>1&&(r=b(r,e[1])),e=d.allKeys(t)):(r=U,e=A(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var u=e[i],a=t[u];r(a,u,t)&&(n[u]=a)}return n}),d.omit=O(function(t,e){var n,r=e[0];return d.isFunction(r)?(r=d.negate(r),e.length>1&&(n=e[1])):(e=d.map(A(e,!1,!1),String),r=function(t,n){return!d.contains(e,n)}),d.pick(t,r,n)}),d.defaults=X(d.allKeys,!0),d.create=function(t,e){var n=k(t);return e&&d.extendOwn(n,e),n},d.clone=function(t){return d.isObject(t)?d.isArray(t)?t.slice():d.extend({},t):t},d.tap=function(t,e){return e(t),t},d.isMatch=function(t,e){var n=d.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var u=n[o];if(e[u]!==i[u]||!(u in i))return!1}return!0},Y=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&L(t,e,n,r)},L=function(t,e,n,r){t instanceof d&&(t=t._wrapped),e instanceof d&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return l.valueOf.call(t)===l.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,a=e.constructor;if(u!==a&&!(d.isFunction(u)&&u instanceof u&&d.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var s=(n=n||[]).length;s--;)if(n[s]===t)return r[s]===e;if(n.push(t),r.push(e),o){if((s=t.length)!==e.length)return!1;for(;s--;)if(!Y(t[s],e[s],n,r))return!1}else{var c,p=d.keys(t);if(s=p.length,d.keys(e).length!==s)return!1;for(;s--;)if(c=p[s],!w(e,c)||!Y(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},d.isEqual=function(t,e){return Y(t,e)},d.isEmpty=function(t){return null==t||(x(t)&&(d.isArray(t)||d.isString(t)||d.isArguments(t))?0===t.length:0===d.keys(t).length)},d.isElement=function(t){return!(!t||1!==t.nodeType)},d.isArray=h||function(t){return"[object Array]"===f.call(t)},d.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){d["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}}),d.isArguments(arguments)||(d.isArguments=function(t){return w(t,"callee")});var R=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof R&&(d.isFunction=function(t){return"function"==typeof t||!1}),d.isFinite=function(t){return!d.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},d.isNaN=function(t){return d.isNumber(t)&&isNaN(t)},d.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},d.isNull=function(t){return null===t},d.isUndefined=function(t){return void 0===t},d.has=function(t,e){if(!d.isArray(e))return w(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!p.call(t,i))return!1;t=t[i]}return!!n},d.noConflict=function(){return i._=o,this},d.identity=function(t){return t},d.constant=function(t){return function(){return t}},d.noop=function(){},d.property=function(t){return d.isArray(t)?function(e){return P(e,t)}:C(t)},d.propertyOf=function(t){return null==t?function(){}:function(e){return d.isArray(e)?P(t,e):t[e]}},d.matcher=d.matches=function(t){return t=d.extendOwn({},t),function(e){return d.isMatch(e,t)}},d.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},d.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},d.now=Date.now||function(){return(new Date).getTime()};var K={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Z=d.invert(K),q=function(t){var e=function(e){return t[e]},n="(?:"+d.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};d.escape=q(K),d.unescape=q(Z),d.result=function(t,e,n){d.isArray(e)||(e=[e]);var r=e.length;if(!r)return d.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=d.isFunction(o)?o.call(t):o}return t};var H=0;d.uniqueId=function(t){var e=++H+"";return t?t+e:e},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+G[t]};d.template=function(t,e,n){!e&&n&&(e=n),e=d.defaults({},e,d.templateSettings);var r,i=RegExp([(e.escape||z).source,(e.interpolate||z).source,(e.evaluate||z).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(i,function(e,n,r,i,a){return u+=t.slice(o,a).replace(W,$),o=a+e.length,n?u+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(u+="';\n"+i+"\n__p+='"),e}),u+="';\n",e.variable||(u="with(obj||{}){\n"+u+"}\n"),u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{r=new Function(e.variable||"obj","_",u)}catch(t){throw t.source=u,t}var a=function(t){return r.call(this,t,d)},l=e.variable||"obj";return a.source="function("+l+"){\n"+u+"}",a},d.chain=function(t){var e=d(t);return e._chain=!0,e};var J=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(t){return d.each(d.functions(t),function(e){var n=d[e]=t[e];d.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),J(this,n.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];d.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],J(this,n)}}),d.each(["concat","join","slice"],function(t){var e=u[t];d.prototype[t]=function(){return J(this,e.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return d}.apply(e,[]))||(n.exports=r)}()}).call(this,n(5),n(12)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(2)),o=u(n(4));function u(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function(){function t(e,n,r,i){a(this,t),this.scene=e,this.childrenList=[],this._groupConfig={x:0,y:0,scaleX:1,scaleY:1,angle:0,alpha:1,visible:!0},this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._angle=0,this._angle=0,this._alpha=1,this._visible=!0,this._isChildComponent=i||!1,this._isChildComponent&&(this._container=e.add.container(0,0),this.childrenList.push(this._container)),this._config=n,this._key=n.key,this._textures=r,this.imageFramesMap={},this._stateManager=new c(this,n),this._childrenById={},this._createImagesMap(r),this._parseConfig()}return r(t,[{key:"setMask",value:function(t){o.default.each(this.childrenList,function(e){e.setMask(t)},this)}},{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n,this._groupConfig)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childrenList,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var r=n.getFrameNames();o.default.each(r,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,r=null,i=null,u=e.childId,a=e.key;if("image"===e.type?r=this._createImageFromConfig(e):"text"===e.type?r=this._createTextFromConfig(e):"tileSprite"===e.type?r=this._createTileSpriteFromConfig(e):"component"===e.type?(r=new t(this.scene,e,this._textures,!0),t._setupCommonParams(r,e),i=r._container):"zone"===e.type?r=this._createHitZoneFromConfig(e):"polygon"===e.type&&(r=this._createPolygonFromConfig(e)),null!==r){if(null===i&&(i=r),this._childrenById[u]=r,e.hasOwnProperty("masking")){var l=r.createGeometryMask();o.default.each(e.masking,function(t){n._childrenById[t].setMask(l)},this)}this._isChildComponent?this._container.add(i):this.childrenList.push(r),this._stateManager.addComponent(r,u,a)}}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var r=e.vertices,i=r.length,o=0;o<i;o+=2)n.lineTo(r[o],r[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}},{key:"groupX",get:function(){return this._groupConfig.x},set:function(t){if(this._groupConfig.x!==t){var e=t-this._groupConfig.x;this._groupConfig.x=t,this.x+=e}}},{key:"groupY",get:function(){return this._groupConfig.y},set:function(t){if(this._groupConfig.y!==t){var e=t-this._groupConfig.y;this._groupConfig.y=t,this.y+=e}}},{key:"groupScaleX",get:function(){return this._groupConfig.scaleX},set:function(t){if(this._groupConfig.scaleX!==t){var e=t/this._groupConfig.scaleX;this._groupConfig.scaleX=t,this.scaleX*=e}}},{key:"groupScaleY",get:function(){return this._groupConfig.scaleY},set:function(t){if(this._groupConfig.scaleY!==t){var e=t/this._groupConfig.scaleY;this._groupConfig.scaleY=t,this.scaleY*=e}}},{key:"groupAlpha",get:function(){return this._groupConfig.alpha},set:function(t){if(this._groupConfig.alpha!==t){var e=t/this._groupConfig.alpha;this._groupConfig.alpha=t,this.alpha*=e}}},{key:"groupVisible",get:function(){return this._groupConfig.visible},set:function(t){this._groupConfig.visible!==t&&(this._groupConfig.visible=t,this._stateManager.setupState())}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;i.default.Actions.IncX(this.childrenList,e),this._x=t}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;i.default.Actions.IncY(this.childrenList,e),this._y=t}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,i.default.Actions.SetVisible(this.childrenList,t))}},{key:"alpha",get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,i.default.Actions.SetAlpha(this.childrenList,t))}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,i.default.Actions.SetScaleX(this.childrenList,t))}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,i.default.Actions.SetScaleY(this.childrenList,t))}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle!==t&&i.default.Actions.PropertyValueSet(this.childrenList,"angle",t)}}],[{key:"_setupCommonParams",value:function(t,e,n){var r=e.x||0,i=e.y||0,o=e.scaleX||1,u=e.scaleY||1,a=e.angle||0,l=e.hasOwnProperty("alpha")?e.alpha:1;n&&(r+=n.x,i+=n.y,o*=n.scaleX,u*=n.scaleY,a+=n.angle,l*=n.alpha),t.x=r,t.y=i,t.scaleX=o,t.scaleY=u,t.angle=a,t.alpha=l}}]),t}();e.default=l;var s=function t(e){a(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){a(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var r=[];for(var i in n.states){this.stateIds.push(i);var u=new s(n.states[i]);this._states[i]=u,r.push(u.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(r))}return r(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=t._clip._groupConfig.visible,l._setupCommonParams(n,t._currentState.config[e],t._clip._groupConfig)},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=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}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},u=n(3),a=(r=u)&&r.__esModule?r:{default:r};var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._select=!1,i}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,a.default),i(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=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}}(),o=a(n(3)),u=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._dragBounds={minX:0,maxX:0,minY:0,maxY:0},i._startDragX=0,i._startDragY=0,i._dragZone=null,i}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,o.default),i(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),i(e,[{key:"setDragBounds",value:function(t,e,n,r){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=r}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,r){if(u.default.check(this.lockId)&&this._dragZone&&this._dragZone===e&&!this.clip){var i=this._startDragX+n,o=this._startDragY+r;i<this._dragBounds.minX?i=this._dragBounds.minX:i>this._dragBounds.maxX&&(i=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",i,o)}}},{key:"_setupInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=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}}(),o=s(n(0)),u=s(n(3)),a=s(n(8)),l=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._vertical=r||!1,i._value=0,i._minValue=0,i._maxValue=1,i._valueStep=0,i._buttonStep=.1,i.btnPrev=new u.default(i,"btn_up"),i.btnPrev.on(u.default.EVENT_CLICK,i.onPrevClick,i),i.btnNext=new u.default(i,"btn_down"),i.btnNext.on(u.default.EVENT_CLICK,i.onNextClick,i),i.thumb=new a.default(i,"thumb"),i.thumb.on(a.default.EVENT_DRAG,i._onThumbDrag,i),i._trackStart=0,i._trackLength=100,i._thumbClip=null,i}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,o.default),i(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),i(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){l.default.check(this.lockId)&&(this.value-=this._buttonStep)}},{key:"onNextClick",value:function(){l.default.check(this.lockId)&&(this.value+=this._buttonStep)}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength&&l.default.check(this.lockId)){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=c},function(t,e,n){t.exports=n(11)},function(t,e,n){"use strict";(function(e){var r=a(n(6)),i=a(n(13)),o=a(n(18)),u=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var l={ComponentClip:r.default,UIComponents:i.default,Plugin:o.default,UIManager:u.default};t.exports=l,e.PhaserComps=l}).call(this,n(5))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(n(3)),i=p(n(14)),o=p(n(0)),u=p(n(7)),a=p(n(8)),l=p(n(9)),s=p(n(15)),c=p(n(16)),f=p(n(17));function p(t){return t&&t.__esModule?t:{default:t}}var h={UIComponentPrototype:o.default,UIButton:r.default,UIButtonSelect:u.default,UIButtonRadio:i.default,UIButtonDraggable:a.default,UIScrollBar:l.default,UIScrollPanel:s.default,UIProgressBar:c.default,UIContainer:f.default};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=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}}(),o=n(7),u=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(t,n,r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var u=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return u._sibling=u,u._value=i,void 0!==o&&u.appendToRadio(o),u}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,u.default),i(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),i(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,r,i){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var u=Object.getPrototypeOf(e);null!==u&&t(u,n,r,i)}else if("value"in o&&o.writable)o.value=r;else{var a=o.set;void 0!==a&&a.call(i,r)}return r}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(0)),o=u(n(9));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(){function t(e,n,r,u,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(i.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=u,this._scrollBar=new o.default(e,r,a),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=a||!1}return r(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=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}}(),o=n(0),u=(r=o)&&r.__esModule?r:{default:r},a=function(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}(n(4));var l=/progress_(\d+)$/,s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._value=0,r._steps=[],r}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,u.default),i(e,[{key:"onClipAppend",value:function(t){(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,r=void 0,i=void 0,o=void 0,u=this._steps.length;for(t=0;t<u-1;t++){var a=this._steps[t],l=this._steps[t+1];if(a.stepValue===this._value){i=a.config;break}if(l.stepValue===this._value){i=l.config;break}if(this._value>a.stepValue&&this._value<l.stepValue){e=a.config,n=l.config,r=(this._value-a.stepValue)/(l.stepValue-a.stepValue);break}}if(!i)for(o in i={},e)if(n.hasOwnProperty(o)){var s=e[o],c=n[o];i[o]={x:s.x+(c.x-s.x)*r,y:s.y+(c.y-s.y)*r,scaleX:s.scaleX+(c.scaleX-s.scaleX)*r,scaleY:s.scaleY+(c.scaleY-s.scaleY)*r,angle:s.angle+(c.angle-s.angle)*r,alpha:s.alpha+(c.alpha-s.alpha)*r}}for(o in i)this._clip.applyChildParams(o,i[o])}}},{key:"_makeSteps",value:function(t){var n=this,r=t.getStateIds();this._steps=[],a.each(r,function(r){if(l.test(r)){var i={},o={stepValue:parseInt(l.exec(r)[1])/100,config:i},u=t.getStateConfig(r);for(var a in u)i[a]=e._makeFullConfig(u[a]);n._steps.push(o)}},this),a.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},o=a(n(0)),u=(a(n(2)),a(n(4)));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._children=[],r._containerClip=null,r}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,o.default),r(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._containerClip?this._addUIComponentToContainerClip(t):t._clip.groupVisible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._containerClip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){var e=this;u.default.each(t._clip.childrenList,function(t){e._containerClip.add(t)},this),t._clip.groupVisible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){var n=this;u.default.each(t._clip.childrenList,function(t){n._containerClip.remove(t,e)},this),t._clip.groupVisible=!1}},{key:"onClipAppend",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._containerClip=t._container,this._containerClip&&u.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),this._containerClip&&u.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;u.default.each(this._children,function(e){t._containerClip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(2)),o=u(n(6));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.addComponent),n}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,i.default.Plugins.BasePlugin),r(e,[{key:"addComponent",value:function(t,e){return new o.default(this.scene,t,e)}}]),e}();e.default=a;var l={key:"UIComponents",plugin:a,start:!0};a.DefaultCfg=l}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser")):"function"==typeof define&&define.amd?define(["phaser"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser")):t.PhaserComps=e(t.Phaser)}(window,function(t){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,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=10)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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}}();n(2);var i,o=n(1);(i=o)&&i.__esModule;var u="event_state",a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.lockId=null,r._parent=t,r._key=n,r._clip=null,r._texts={},n&&t&&t.on(u,r._onEventState,r),r._clipUpdate(),r}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,Phaser.Events.EventEmitter),r(e,null,[{key:"EVENT_STATE",get:function(){return u}}]),r(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(u,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(u)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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}}();var i=!1,o=[],u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"lock",value:function(t){this.unlock(),"string"==typeof t?o.push(t):t.forEach(function(t){return o.push(t)}),i=!0}},{key:"unlock",value:function(){o.length=0,i=!1}},{key:"check",value:function(t){return!i||-1!==o.indexOf(t)}}]),t}();e.default=u},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(0)),o=u(n(1));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._enable=!0,i._isPressed=!1,i._isOver=!1,r&&(i.label=r),i}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,i.default),r(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),r(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&o.default.check(this.lockId)&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=a},function(t,e,n){(function(t,n){var r;!function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||this||{},o=i._,u=Array.prototype,a=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,s=u.push,c=u.slice,f=a.toString,p=a.hasOwnProperty,h=Array.isArray,_=Object.keys,v=Object.create,y=function(){},d=function(t){return t instanceof d?t:this instanceof d?void(this._wrapped=t):new d(t)};e.nodeType?i._=d:(!n.nodeType&&n.exports&&(e=n.exports=d),e._=d),d.VERSION="1.9.1";var g,b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},m=function(t,e,n){return d.iteratee!==g?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?b(t,e,n):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)};d.iteratee=g=function(t,e){return m(t,e,1/0)};var O=function(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}},k=function(t){if(!d.isObject(t))return{};if(v)return v(t);y.prototype=t;var e=new y;return y.prototype=null,e},w=function(t){return function(e){return null==e?void 0:e[t]}},C=function(t,e){return null!=t&&p.call(t,e)},P=function(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0},j=Math.pow(2,53)-1,S=w("length"),x=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=j};d.each=d.forEach=function(t,e,n){var r,i;if(e=b(e,n),x(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=d.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},d.map=d.collect=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=Array(i),u=0;u<i;u++){var a=r?r[u]:u;o[u]=e(t[a],a,t)}return o};var I=function(t){return function(e,n,r,i){var o=arguments.length>=3;return function(e,n,r,i){var o=!x(e)&&d.keys(e),u=(o||e).length,a=t>0?0:u-1;for(i||(r=e[o?o[a]:a],a+=t);a>=0&&a<u;a+=t){var l=o?o[a]:a;r=n(r,e[l],l,e)}return r}(e,b(n,i,4),r,o)}};d.reduce=d.foldl=d.inject=I(1),d.reduceRight=d.foldr=I(-1),d.find=d.detect=function(t,e,n){var r=(x(t)?d.findIndex:d.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},d.filter=d.select=function(t,e,n){var r=[];return e=m(e,n),d.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},d.reject=function(t,e,n){return d.filter(t,d.negate(m(e)),n)},d.every=d.all=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(!e(t[u],u,t))return!1}return!0},d.some=d.any=function(t,e,n){e=m(e,n);for(var r=!x(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var u=r?r[o]:o;if(e(t[u],u,t))return!0}return!1},d.contains=d.includes=d.include=function(t,e,n,r){return x(t)||(t=d.values(t)),("number"!=typeof n||r)&&(n=0),d.indexOf(t,e,n)>=0},d.invoke=O(function(t,e,n){var r,i;return d.isFunction(e)?i=e:d.isArray(e)&&(r=e.slice(0,-1),e=e[e.length-1]),d.map(t,function(t){var o=i;if(!o){if(r&&r.length&&(t=P(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)})}),d.pluck=function(t,e){return d.map(t,d.property(e))},d.where=function(t,e){return d.filter(t,d.matcher(e))},d.findWhere=function(t,e){return d.find(t,d.matcher(e))},d.max=function(t,e,n){var r,i,o=-1/0,u=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=x(t)?t:d.values(t)).length;a<l;a++)null!=(r=t[a])&&r>o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))>u||i===-1/0&&o===-1/0)&&(o=t,u=i)});return o},d.min=function(t,e,n){var r,i,o=1/0,u=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=x(t)?t:d.values(t)).length;a<l;a++)null!=(r=t[a])&&r<o&&(o=r);else e=m(e,n),d.each(t,function(t,n,r){((i=e(t,n,r))<u||i===1/0&&o===1/0)&&(o=t,u=i)});return o},d.shuffle=function(t){return d.sample(t,1/0)},d.sample=function(t,e,n){if(null==e||n)return x(t)||(t=d.values(t)),t[d.random(t.length-1)];var r=x(t)?d.clone(t):d.values(t),i=S(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,u=0;u<e;u++){var a=d.random(u,o),l=r[u];r[u]=r[a],r[a]=l}return r.slice(0,e)},d.sortBy=function(t,e,n){var r=0;return e=m(e,n),d.pluck(d.map(t,function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var E=function(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=m(r,i),d.each(n,function(e,i){var u=r(e,i,n);t(o,e,u)}),o}};d.groupBy=E(function(t,e,n){C(t,n)?t[n].push(e):t[n]=[e]}),d.indexBy=E(function(t,e,n){t[n]=e}),d.countBy=E(function(t,e,n){C(t,n)?t[n]++:t[n]=1});var T=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(t){return t?d.isArray(t)?c.call(t):d.isString(t)?t.match(T):x(t)?d.map(t,d.identity):d.values(t):[]},d.size=function(t){return null==t?0:x(t)?t.length:d.keys(t).length},d.partition=E(function(t,e,n){t[n?0:1].push(e)},!0),d.first=d.head=d.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:d.initial(t,t.length-e)},d.initial=function(t,e,n){return c.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},d.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:d.rest(t,Math.max(0,t.length-e))},d.rest=d.tail=d.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},d.compact=function(t){return d.filter(t,Boolean)};var M=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,u=S(t);o<u;o++){var a=t[o];if(x(a)&&(d.isArray(a)||d.isArguments(a)))if(e)for(var l=0,s=a.length;l<s;)r[i++]=a[l++];else M(a,e,n,r),i=r.length;else n||(r[i++]=a)}return r};d.flatten=function(t,e){return M(t,e,!1)},d.without=O(function(t,e){return d.difference(t,e)}),d.uniq=d.unique=function(t,e,n,r){d.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=m(n,r));for(var i=[],o=[],u=0,a=S(t);u<a;u++){var l=t[u],s=n?n(l,u,t):l;e&&!n?(u&&o===s||i.push(l),o=s):n?d.contains(o,s)||(o.push(s),i.push(l)):d.contains(i,l)||i.push(l)}return i},d.union=O(function(t){return d.uniq(M(t,!0,!0))}),d.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=S(t);r<i;r++){var o=t[r];if(!d.contains(e,o)){var u;for(u=1;u<n&&d.contains(arguments[u],o);u++);u===n&&e.push(o)}}return e},d.difference=O(function(t,e){return e=M(e,!0,!0),d.filter(t,function(t){return!d.contains(e,t)})}),d.unzip=function(t){for(var e=t&&d.max(t,S).length||0,n=Array(e),r=0;r<e;r++)n[r]=d.pluck(t,r);return n},d.zip=O(d.unzip),d.object=function(t,e){for(var n={},r=0,i=S(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};var A=function(t){return function(e,n,r){n=m(n,r);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}};d.findIndex=A(1),d.findLastIndex=A(-1),d.sortedIndex=function(t,e,n,r){for(var i=(n=m(n,r,1))(e),o=0,u=S(t);o<u;){var a=Math.floor((o+u)/2);n(t[a])<i?o=a+1:u=a}return o};var B=function(t,e,n){return function(r,i,o){var u=0,a=S(r);if("number"==typeof o)t>0?u=o>=0?o:Math.max(o+a,u):a=o>=0?Math.min(o+1,a):o+a+1;else if(n&&o&&a)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(c.call(r,u,a),d.isNaN))>=0?o+u:-1;for(o=t>0?u:a-1;o>=0&&o<a;o+=t)if(r[o]===i)return o;return-1}};d.indexOf=B(1,d.findIndex,d.sortedIndex),d.lastIndexOf=B(-1,d.findLastIndex),d.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},d.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(c.call(t,r,r+=e));return n};var F=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=k(t.prototype),u=t.apply(o,i);return d.isObject(u)?u:o};d.bind=O(function(t,e,n){if(!d.isFunction(t))throw new TypeError("Bind must be called on a function");var r=O(function(i){return F(t,r,e,this,n.concat(i))});return r}),d.partial=O(function(t,e){var n=d.partial.placeholder,r=function(){for(var i=0,o=e.length,u=Array(o),a=0;a<o;a++)u[a]=e[a]===n?arguments[i++]:e[a];for(;i<arguments.length;)u.push(arguments[i++]);return F(t,r,this,this,u)};return r}),d.partial.placeholder=d,d.bindAll=O(function(t,e){var n=(e=M(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=d.bind(t[r],t)}}),d.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return C(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},d.delay=O(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(t,e,n){var r,i,o,u,a=0;n||(n={});var l=function(){a=!1===n.leading?0:d.now(),r=null,u=t.apply(i,o),r||(i=o=null)},s=function(){var s=d.now();a||!1!==n.leading||(a=s);var c=e-(s-a);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),a=s,u=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),u};return s.cancel=function(){clearTimeout(r),a=0,r=i=o=null},s},d.debounce=function(t,e,n){var r,i,o=function(e,n){r=null,n&&(i=t.apply(e,n))},u=O(function(u){if(r&&clearTimeout(r),n){var a=!r;r=setTimeout(o,e),a&&(i=t.apply(this,u))}else r=d.delay(o,e,this,u);return i});return u.cancel=function(){clearTimeout(r),r=null},u},d.wrap=function(t,e){return d.partial(e,t)},d.negate=function(t){return function(){return!t.apply(this,arguments)}},d.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},d.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},d.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},d.once=d.partial(d.before,2),d.restArguments=O;var D=!{toString:null}.propertyIsEnumerable("toString"),V=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],N=function(t,e){var n=V.length,r=t.constructor,i=d.isFunction(r)&&r.prototype||a,o="constructor";for(C(t,o)&&!d.contains(e,o)&&e.push(o);n--;)(o=V[n])in t&&t[o]!==i[o]&&!d.contains(e,o)&&e.push(o)};d.keys=function(t){if(!d.isObject(t))return[];if(_)return _(t);var e=[];for(var n in t)C(t,n)&&e.push(n);return D&&N(t,e),e},d.allKeys=function(t){if(!d.isObject(t))return[];var e=[];for(var n in t)e.push(n);return D&&N(t,e),e},d.values=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},d.mapObject=function(t,e,n){e=m(e,n);for(var r=d.keys(t),i=r.length,o={},u=0;u<i;u++){var a=r[u];o[a]=e(t[a],a,t)}return o},d.pairs=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},d.invert=function(t){for(var e={},n=d.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},d.functions=d.methods=function(t){var e=[];for(var n in t)d.isFunction(t[n])&&e.push(n);return e.sort()};var U=function(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],u=t(o),a=u.length,l=0;l<a;l++){var s=u[l];e&&void 0!==n[s]||(n[s]=o[s])}return n}};d.extend=U(d.allKeys),d.extendOwn=d.assign=U(d.keys),d.findKey=function(t,e,n){e=m(e,n);for(var r,i=d.keys(t),o=0,u=i.length;o<u;o++)if(e(t[r=i[o]],r,t))return r};var R,K,L=function(t,e,n){return e in n};d.pick=O(function(t,e){var n={},r=e[0];if(null==t)return n;d.isFunction(r)?(e.length>1&&(r=b(r,e[1])),e=d.allKeys(t)):(r=L,e=M(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var u=e[i],a=t[u];r(a,u,t)&&(n[u]=a)}return n}),d.omit=O(function(t,e){var n,r=e[0];return d.isFunction(r)?(r=d.negate(r),e.length>1&&(n=e[1])):(e=d.map(M(e,!1,!1),String),r=function(t,n){return!d.contains(e,n)}),d.pick(t,r,n)}),d.defaults=U(d.allKeys,!0),d.create=function(t,e){var n=k(t);return e&&d.extendOwn(n,e),n},d.clone=function(t){return d.isObject(t)?d.isArray(t)?t.slice():d.extend({},t):t},d.tap=function(t,e){return e(t),t},d.isMatch=function(t,e){var n=d.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var u=n[o];if(e[u]!==i[u]||!(u in i))return!1}return!0},R=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&K(t,e,n,r)},K=function(t,e,n,r){t instanceof d&&(t=t._wrapped),e instanceof d&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return l.valueOf.call(t)===l.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,a=e.constructor;if(u!==a&&!(d.isFunction(u)&&u instanceof u&&d.isFunction(a)&&a instanceof a)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var s=(n=n||[]).length;s--;)if(n[s]===t)return r[s]===e;if(n.push(t),r.push(e),o){if((s=t.length)!==e.length)return!1;for(;s--;)if(!R(t[s],e[s],n,r))return!1}else{var c,p=d.keys(t);if(s=p.length,d.keys(e).length!==s)return!1;for(;s--;)if(c=p[s],!C(e,c)||!R(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},d.isEqual=function(t,e){return R(t,e)},d.isEmpty=function(t){return null==t||(x(t)&&(d.isArray(t)||d.isString(t)||d.isArguments(t))?0===t.length:0===d.keys(t).length)},d.isElement=function(t){return!(!t||1!==t.nodeType)},d.isArray=h||function(t){return"[object Array]"===f.call(t)},d.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){d["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}}),d.isArguments(arguments)||(d.isArguments=function(t){return C(t,"callee")});var X=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof X&&(d.isFunction=function(t){return"function"==typeof t||!1}),d.isFinite=function(t){return!d.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},d.isNaN=function(t){return d.isNumber(t)&&isNaN(t)},d.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},d.isNull=function(t){return null===t},d.isUndefined=function(t){return void 0===t},d.has=function(t,e){if(!d.isArray(e))return C(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!p.call(t,i))return!1;t=t[i]}return!!n},d.noConflict=function(){return i._=o,this},d.identity=function(t){return t},d.constant=function(t){return function(){return t}},d.noop=function(){},d.property=function(t){return d.isArray(t)?function(e){return P(e,t)}:w(t)},d.propertyOf=function(t){return null==t?function(){}:function(e){return d.isArray(e)?P(t,e):t[e]}},d.matcher=d.matches=function(t){return t=d.extendOwn({},t),function(e){return d.isMatch(e,t)}},d.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},d.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},d.now=Date.now||function(){return(new Date).getTime()};var Y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Z=d.invert(Y),q=function(t){var e=function(e){return t[e]},n="(?:"+d.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};d.escape=q(Y),d.unescape=q(Z),d.result=function(t,e,n){d.isArray(e)||(e=[e]);var r=e.length;if(!r)return d.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=d.isFunction(o)?o.call(t):o}return t};var H=0;d.uniqueId=function(t){var e=++H+"";return t?t+e:e},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+G[t]};d.template=function(t,e,n){!e&&n&&(e=n),e=d.defaults({},e,d.templateSettings);var r,i=RegExp([(e.escape||z).source,(e.interpolate||z).source,(e.evaluate||z).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(i,function(e,n,r,i,a){return u+=t.slice(o,a).replace(W,$),o=a+e.length,n?u+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(u+="';\n"+i+"\n__p+='"),e}),u+="';\n",e.variable||(u="with(obj||{}){\n"+u+"}\n"),u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{r=new Function(e.variable||"obj","_",u)}catch(t){throw t.source=u,t}var a=function(t){return r.call(this,t,d)},l=e.variable||"obj";return a.source="function("+l+"){\n"+u+"}",a},d.chain=function(t){var e=d(t);return e._chain=!0,e};var J=function(t,e){return t._chain?d(e).chain():e};d.mixin=function(t){return d.each(d.functions(t),function(e){var n=d[e]=t[e];d.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),J(this,n.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];d.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],J(this,n)}}),d.each(["concat","join","slice"],function(t){var e=u[t];d.prototype[t]=function(){return J(this,e.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return d}.apply(e,[]))||(n.exports=r)}()}).call(this,n(5),n(12)(t))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(2)),o=u(n(4));function u(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function(t){function e(t,n,r){a(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,0,0));return i.childComponentClips=[],i._config=n,i._key=n.key,i._textures=r,i.imageFramesMap={},i._stateManager=new c(i,n),i._childrenById={},i._createImagesMap(r),i._parseConfig(),i}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,i.default.GameObjects.Container),r(e,[{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(t,n){this._childrenById.hasOwnProperty(t)&&e._setupCommonParams(this._childrenById[t],n)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childComponentClips,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var r=n.getFrameNames();o.default.each(r,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(t){var n=this,r=null,i=t.childId,u=t.key,a=!0;if("image"===t.type)r=this._createImageFromConfig(t);else if("text"===t.type)r=this._createTextFromConfig(t);else if("tileSprite"===t.type)r=this._createTileSpriteFromConfig(t);else if("component"===t.type)r=new e(this.scene,t,this._textures),e._setupCommonParams(r,t);else if("zone"===t.type)r=this._createHitZoneFromConfig(t);else if("polygon"===t.type&&(r=this._createPolygonFromConfig(t),t.hasOwnProperty("masking"))){var l=r.createGeometryMask();o.default.each(t.masking,function(t){n._childrenById[t].setMask(l)},this),a=!1}null!==r&&(this._childrenById[i]=r,this.childComponentClips.push(r),a&&this.add(r),this._stateManager.addComponent(r,i,u))}},{key:"_createPolygonFromConfig",value:function(t){var n=this.scene.make.graphics();n.fillStyle(t.color,t.hasOwnProperty("alpha")?t.alpha:1),n.beginPath();for(var r=t.vertices,i=r.length,o=0;o<i;o+=2)n.lineTo(r[o],r[o+1]);return n.closePath(),n.fillPath(),e._setupCommonParams(n,t),t.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(t){var n=this.scene.add.tileSprite(0,0,t.width,t.height,this.imageFramesMap[t.image],t.image);return n.setOrigin(.5,.5),e._setupCommonParams(n,t),n}},{key:"_createImageFromConfig",value:function(t){var n=this.scene.add.image(0,0,this.imageFramesMap[t.image],t.image);return n.setOrigin(0),e._setupCommonParams(n,t),n}},{key:"_createTextFromConfig",value:function(t){var n=this.scene.add.text(0,0,t.text,t.textStyle);return"center"===t.textStyle.align?n.setOrigin(.5,0):"right"===t.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),e._setupCommonParams(n,t),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}}],[{key:"_setupCommonParams",value:function(t,e){var n=e.x||0,r=e.y||0,i=e.scaleX||1,o=e.scaleY||1,u=e.angle||0,a=e.hasOwnProperty("alpha")?e.alpha:1;t.x=n,t.y=r,t.scaleX=i,t.scaleY=o,t.angle=u,t.alpha=a}}]),e}();e.default=l;var s=function t(e){a(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){a(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var r=[];for(var i in n.states){this.stateIds.push(i);var u=new s(n.states[i]);this._states[i]=u,r.push(u.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(r))}return r(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=!0,l._setupCommonParams(n,t._currentState.config[e])},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=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}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},u=n(3),a=(r=u)&&r.__esModule?r:{default:r};var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._select=!1,i}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,a.default),i(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=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}}(),o=a(n(3)),u=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return i._dragBounds={minX:0,maxX:0,minY:0,maxY:0},i._startDragX=0,i._startDragY=0,i._dragZone=null,i}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,o.default),i(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),i(e,[{key:"setDragBounds",value:function(t,e,n,r){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=r}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,r){if(u.default.check(this.lockId)&&this._dragZone&&this._dragZone===e&&!this.clip){var i=this._startDragX+n,o=this._startDragY+r;i<this._dragBounds.minX?i=this._dragBounds.minX:i>this._dragBounds.maxX&&(i=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",i,o)}}},{key:"_setupInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},i=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}}(),o=s(n(0)),u=s(n(3)),a=s(n(8)),l=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._vertical=r||!1,i._value=0,i._minValue=0,i._maxValue=1,i._valueStep=0,i._buttonStep=.1,i.btnPrev=new u.default(i,"btn_up"),i.btnPrev.on(u.default.EVENT_CLICK,i.onPrevClick,i),i.btnNext=new u.default(i,"btn_down"),i.btnNext.on(u.default.EVENT_CLICK,i.onNextClick,i),i.thumb=new a.default(i,"thumb"),i.thumb.on(a.default.EVENT_DRAG,i._onThumbDrag,i),i._trackStart=0,i._trackLength=100,i._thumbClip=null,i}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,o.default),i(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),i(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){l.default.check(this.lockId)&&(this.value-=this._buttonStep)}},{key:"onNextClick",value:function(){l.default.check(this.lockId)&&(this.value+=this._buttonStep)}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength&&l.default.check(this.lockId)){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=c},function(t,e,n){t.exports=n(11)},function(t,e,n){"use strict";(function(e){var r=a(n(6)),i=a(n(13)),o=a(n(18)),u=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var l={ComponentClip:r.default,UIComponents:i.default,Plugin:o.default,UIManager:u.default};t.exports=l,e.PhaserComps=l}).call(this,n(5))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=p(n(3)),i=p(n(14)),o=p(n(0)),u=p(n(7)),a=p(n(8)),l=p(n(9)),s=p(n(15)),c=p(n(16)),f=p(n(17));function p(t){return t&&t.__esModule?t:{default:t}}var h={UIComponentPrototype:o.default,UIButton:r.default,UIButtonSelect:u.default,UIButtonRadio:i.default,UIButtonDraggable:a.default,UIScrollBar:l.default,UIScrollPanel:s.default,UIProgressBar:c.default,UIContainer:f.default};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=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}}(),o=n(7),u=(r=o)&&r.__esModule?r:{default:r};var a=function(t){function e(t,n,r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var u=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,r));return u._sibling=u,u._value=i,void 0!==o&&u.appendToRadio(o),u}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,u.default),i(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),i(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,r,i){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var u=Object.getPrototypeOf(e);null!==u&&t(u,n,r,i)}else if("value"in o&&o.writable)o.value=r;else{var a=o.set;void 0!==a&&a.call(i,r)}return r}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=u(n(0)),o=u(n(9));function u(t){return t&&t.__esModule?t:{default:t}}var a=function(){function t(e,n,r,u,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(i.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=u,this._scrollBar=new o.default(e,r,a),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=a||!1}return r(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=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}}(),o=n(0),u=(r=o)&&r.__esModule?r:{default:r},a=function(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}(n(4));var l=/progress_(\d+)$/,s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._value=0,r._steps=[],r}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,u.default),i(e,[{key:"onClipAppend",value:function(t){(function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,r=void 0,i=void 0,o=void 0,u=this._steps.length;for(t=0;t<u-1;t++){var a=this._steps[t],l=this._steps[t+1];if(a.stepValue===this._value){i=a.config;break}if(l.stepValue===this._value){i=l.config;break}if(this._value>a.stepValue&&this._value<l.stepValue){e=a.config,n=l.config,r=(this._value-a.stepValue)/(l.stepValue-a.stepValue);break}}if(!i)for(o in i={},e)if(n.hasOwnProperty(o)){var s=e[o],c=n[o];i[o]={x:s.x+(c.x-s.x)*r,y:s.y+(c.y-s.y)*r,scaleX:s.scaleX+(c.scaleX-s.scaleX)*r,scaleY:s.scaleY+(c.scaleY-s.scaleY)*r,angle:s.angle+(c.angle-s.angle)*r,alpha:s.alpha+(c.alpha-s.alpha)*r}}for(o in i)this._clip.applyChildParams(o,i[o])}}},{key:"_makeSteps",value:function(t){var n=this,r=t.getStateIds();this._steps=[],a.each(r,function(r){if(l.test(r)){var i={},o={stepValue:parseInt(l.exec(r)[1])/100,config:i},u=t.getStateConfig(r);for(var a in u)i[a]=e._makeFullConfig(u[a]);n._steps.push(o)}},this),a.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var u=i.get;return void 0!==u?u.call(r):void 0},o=a(n(0));n(2);var u=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._children=[],r}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,o.default),r(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._clip?(t._clip.visible=!0,this._addUIComponentToContainerClip(t)):t._clip.visible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._clip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){this._clip.add(t._clip),t._clip.visible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){this._clip.remove(t._clip,e),t._clip.visible=!1}},{key:"onClipAppend",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),t&&u.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),t&&u.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;u.default.each(this._children,function(e){t._clip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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}}();n(2);var i,o=n(6),u=(i=o)&&i.__esModule?i:{default:i};var a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.makeComponent),n}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,Phaser.Plugins.BasePlugin),r(e,[{key:"addComponent",value:function(t,e){var n=new u.default(this.scene,t,e);return this.scene.add.existing(n),n}},{key:"makeComponent",value:function(t,e){return new u.default(this.scene,t,e)}}]),e}();e.default=a;var l={key:"UIComponents",plugin:a,start:!0};a.DefaultCfg=l}])});

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("phaser"),require("underscore")):"function"==typeof define&&define.amd?define(["phaser","underscore"],e):"object"==typeof exports?exports.PhaserComps=e(require("phaser"),require("underscore")):t.PhaserComps=e(t.Phaser,t._)}(window,function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},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=9)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=o(n(2));o(n(1));function o(t){return t&&t.__esModule?t:{default:t}}var a="event_state",s=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.lockId=null,i._parent=t,i._key=n,i._clip=null,i._texts={},n&&t&&t.on(a,i._onEventState,i),i._clipUpdate(),i}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,r.default.Events.EventEmitter),i(e,null,[{key:"EVENT_STATE",get:function(){return a}}]),i(e,[{key:"appendClip",value:function(t){this._clip!==t&&(null!==this._clip&&this.removeClip(),this._clip=t,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(t){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(t){}},{key:"doState",value:function(){var t=this.getStateId();this._setupState(t)}},{key:"getText",value:function(t){return this._texts[t]}},{key:"setText",value:function(t,e){if(this._texts[t]!==e&&(this._texts[t]=e,this._clip)){var n=this._clip.getChildText(t);n&&(n.text=e)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(a,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var t=this._parent._clip.getChildClip(this._key);this.appendClip(t)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(t){if(this._clip)for(var e in this._clip.setState(t),this._texts){var n=this._clip.getChildText(e);n&&(n.text=this._texts[e])}this.emit(a)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();var r=!1,o=[],a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"lock",value:function(t){this.unlock(),"string"==typeof t?o.push(t):t.forEach(function(t){return o.push(t)}),r=!0}},{key:"unlock",value:function(){o.length=0,r=!1}},{key:"check",value:function(t){return!r||-1!==o.indexOf(t)}}]),t}();e.default=a},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(0)),o=a(n(1));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._enable=!0,r._isPressed=!1,r._isOver=!1,i&&(r.label=i),r}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,r.default),i(e,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),i(e,[{key:"onClipAppend",value:function(t){this._updateInteractive()}},{key:"onClipRemove",value:function(t){var e=t.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}},{key:"_setupInteractive",value:function(t){t.setInteractive({useHandCursor:!0}),t.on("pointerdown",this._onPointerDown,this),t.on("pointerup",this._onPointerUp,this),t.on("pointerover",this._onPointerOver,this),t.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(t){t.disableInteractive(),t.removeListener("pointerdown",this._onPointerDown,this),t.removeListener("pointerup",this._onPointerUp,this),t.removeListener("pointerover",this._onPointerOver,this),t.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&(this.enable?this._setupInteractive(t):this._removeInteractive(t))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var t=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),t&&o.default.check(this.lockId)&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var t=this._clip.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}(function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(t){this.setText("label",t)}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(this._enable=t,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),e}();e.default=s},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(2)),o=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function(){function t(e,n,i,r){s(this,t),this.scene=e,this.childrenList=[],this._groupConfig={x:0,y:0,scaleX:1,scaleY:1,angle:0,alpha:1,visible:!0},this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._angle=0,this._angle=0,this._alpha=1,this._visible=!0,this._isChildComponent=r||!1,this._isChildComponent&&(this._container=e.add.container(0,0),this.childrenList.push(this._container)),this._config=n,this._key=n.key,this._textures=i,this.imageFramesMap={},this._stateManager=new c(this,n),this._childrenById={},this._createImagesMap(i),this._parseConfig()}return i(t,[{key:"setMask",value:function(t){o.default.each(this.childrenList,function(e){e.setMask(t)},this)}},{key:"getStateConfig",value:function(t){return this._stateManager.getStateConfigById(t)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(t,e){this._stateManager.setState(t,e)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n,this._groupConfig)}},{key:"getChildClip",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"getChildText",value:function(t){return this._stateManager.getActiveComponentByKey(t)}},{key:"destroy",value:function(){o.default.each(this.childrenList,function(t){t.destroy()},this)}},{key:"_createImagesMap",value:function(t){var e=this;o.default.each(t,function(t){var n=e.scene.textures.get(t);if(n){var i=n.getFrameNames();o.default.each(i,function(n){e.imageFramesMap[n]=t},e)}},this)}},{key:"_parseConfig",value:function(){var t=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(e){t._createChildFromConfig(e)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,i=null,r=null,a=e.childId,s=e.key;if("image"===e.type?i=this._createImageFromConfig(e):"text"===e.type?i=this._createTextFromConfig(e):"tileSprite"===e.type?i=this._createTileSpriteFromConfig(e):"component"===e.type?(i=new t(this.scene,e,this._textures,!0),t._setupCommonParams(i,e),r=i._container):"zone"===e.type?i=this._createHitZoneFromConfig(e):"polygon"===e.type&&(i=this._createPolygonFromConfig(e)),null!==i){if(null===r&&(r=i),this._childrenById[a]=i,e.hasOwnProperty("masking")){var u=i.createGeometryMask();o.default.each(e.masking,function(t){n._childrenById[t].setMask(u)},this)}this._isChildComponent?this._container.add(r):this.childrenList.push(i),this._stateManager.addComponent(i,a,s)}}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var i=e.vertices,r=i.length,o=0;o<r;o+=2)n.lineTo(i[o],i[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(t){return this.scene.add.zone(t.x||0,t.y||0,t.width,t.height).setOrigin(0)}},{key:"groupX",get:function(){return this._groupConfig.x},set:function(t){if(this._groupConfig.x!==t){var e=t-this._groupConfig.x;this._groupConfig.x=t,this.x+=e}}},{key:"groupY",get:function(){return this._groupConfig.y},set:function(t){if(this._groupConfig.y!==t){var e=t-this._groupConfig.y;this._groupConfig.y=t,this.y+=e}}},{key:"groupScaleX",get:function(){return this._groupConfig.scaleX},set:function(t){if(this._groupConfig.scaleX!==t){var e=t/this._groupConfig.scaleX;this._groupConfig.scaleX=t,this.scaleX*=e}}},{key:"groupScaleY",get:function(){return this._groupConfig.scaleY},set:function(t){if(this._groupConfig.scaleY!==t){var e=t/this._groupConfig.scaleY;this._groupConfig.scaleY=t,this.scaleY*=e}}},{key:"groupAlpha",get:function(){return this._groupConfig.alpha},set:function(t){if(this._groupConfig.alpha!==t){var e=t/this._groupConfig.alpha;this._groupConfig.alpha=t,this.alpha*=e}}},{key:"groupVisible",get:function(){return this._groupConfig.visible},set:function(t){this._groupConfig.visible!==t&&(this._groupConfig.visible=t,this._stateManager.setupState())}},{key:"x",get:function(){return this._x},set:function(t){var e=t-this.x;r.default.Actions.IncX(this.childrenList,e),this._x=t}},{key:"y",get:function(){return this._y},set:function(t){var e=t-this.y;r.default.Actions.IncY(this.childrenList,e),this._y=t}},{key:"visible",get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,r.default.Actions.SetVisible(this.childrenList,t))}},{key:"alpha",get:function(){return this._alpha},set:function(t){this._alpha!==t&&(this._alpha=t,r.default.Actions.SetAlpha(this.childrenList,t))}},{key:"scaleX",get:function(){return this._scaleX},set:function(t){this._scaleX!==t&&(this._scaleX=t,r.default.Actions.SetScaleX(this.childrenList,t))}},{key:"scaleY",get:function(){return this._scaleY},set:function(t){this._scaleY!==t&&(this._scaleY=t,r.default.Actions.SetScaleY(this.childrenList,t))}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle!==t&&r.default.Actions.PropertyValueSet(this.childrenList,"angle",t)}}],[{key:"_setupCommonParams",value:function(t,e,n){var i=e.x||0,r=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=e.angle||0,u=e.hasOwnProperty("alpha")?e.alpha:1;n&&(i+=n.x,r+=n.y,o*=n.scaleX,a*=n.scaleY,s+=n.angle,u*=n.alpha),t.x=i,t.y=r,t.scaleX=o,t.scaleY=a,t.angle=s,t.alpha=u}}]),t}();e.default=u;var l=function t(e){s(this,t),this.config=e,this.componentIds=[],this.componentIds=Object.keys(e)},c=function(){function t(e,n){s(this,t),this._clip=e,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var i=[];for(var r in n.states){this.stateIds.push(r);var a=new l(n.states[r]);this._states[r]=a,i.push(a.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(i))}return i(t,[{key:"getStateConfigById",value:function(t){return this._states.hasOwnProperty(t)?this._states[t].config:null}},{key:"addComponent",value:function(t,e,n){-1===o.default.indexOf(this._dynamicChildrenIds,e)?void 0!==n&&(this._residentComponentsByKey[n]=t):(this._components[e]=t,void 0!==n&&(this._componentKeys[e]=n))}},{key:"setState",value:function(t,e){(this._currentStateId!==t||e)&&this._states.hasOwnProperty(t)&&(this._currentStateId=t,this._currentState=this._states[t],this.setupState())}},{key:"getActiveComponentByKey",value:function(t){if(this._residentComponentsByKey.hasOwnProperty(t))return this._residentComponentsByKey[t];if(null===this._currentState)return null;for(var e in this._currentState.componentIds){var n=this._currentState.componentIds[e];if(this._componentKeys[n]===t)return this._components[n]}return null}},{key:"setupState",value:function(){var t=this,e=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,e);o.default.each(n,function(e){t._components[e].visible=!1},this),o.default.each(e,function(e){var n=t._components[e];n.visible=t._clip._groupConfig.visible,u._setupCommonParams(n,t._currentState.config[e],t._clip._groupConfig)},this)}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},a=n(3),s=(i=a)&&i.__esModule?i:{default:i};var u=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return r._select=!1,r}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,s.default),r(e,[{key:"getStateId",value:function(){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(t){this._select!==t&&(this._select=t,this.doState())}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=s(n(3)),a=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return r._dragBounds={minX:0,maxX:0,minY:0,maxY:0},r._startDragX=0,r._startDragY=0,r._dragZone=null,r}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,o.default),r(e,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),r(e,[{key:"setDragBounds",value:function(t,e,n,i){this._dragBounds.minX=t,this._dragBounds.maxX=n,this._dragBounds.minY=e,this._dragBounds.maxY=i}},{key:"_onDragStart",value:function(t,e){this._dragZone&&this._dragZone===e&&this._clip&&(this._startDragX=this._clip.x-e.input.dragStartX,this._startDragY=this._clip.y-e.input.dragStartY)}},{key:"_onDrag",value:function(t,e,n,i){if(a.default.check(this.lockId)&&this._dragZone&&this._dragZone===e&&!this.clip){var r=this._startDragX+n,o=this._startDragY+i;r<this._dragBounds.minX?r=this._dragBounds.minX:r>this._dragBounds.maxX&&(r=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",r,o)}}},{key:"_setupInteractive",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setupInteractive",this).call(this,t),this._dragZone=t,t.scene.input.setDraggable(t,!0),t.scene.input.on("dragstart",this._onDragStart,this),t.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_removeInteractive",this).call(this,t),this._dragZone=null,t.scene.input.setDraggable(t,!1),t.scene.input.removeListener("dragstart",this._onDragStart),t.scene.input.removeListener("drag",this._onDrag)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=l(n(0)),a=l(n(3)),s=l(n(7)),u=l(n(1));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r._vertical=i||!1,r._value=0,r._minValue=0,r._maxValue=1,r._valueStep=0,r._buttonStep=.1,r.btnPrev=new a.default(r,"btn_up"),r.btnPrev.on(a.default.EVENT_CLICK,r.onPrevClick,r),r.btnNext=new a.default(r,"btn_down"),r.btnNext.on(a.default.EVENT_CLICK,r.onNextClick,r),r.thumb=new s.default(r,"thumb"),r.thumb.on(s.default.EVENT_DRAG,r._onThumbDrag,r),r._trackStart=0,r._trackLength=100,r._thumbClip=null,r}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,o.default),r(e,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),r(e,[{key:"setValueBounds",value:function(t,e,n){this._minValue=t,this._maxValue=e,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(t){this._buttonStep=t}},{key:"onClipAppend",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var t=this._clip.getChildClip("DIMENSIONS");t&&(this._trackStart=this._vertical?t.y:t.x,this._trackLength=this._vertical?t.height:t.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:t.x,this._vertical?t.y:this._thumbClip.y,this._vertical?this._thumbClip.x:t.x+t.width,this._vertical?t.y+t.height:this._thumbClip.y));var e=this._clip.getChildClip("HIT_ZONE");e&&e.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){u.default.check(this.lockId)&&(this.value-=this._buttonStep)}},{key:"onNextClick",value:function(){u.default.check(this.lockId)&&(this.value+=this._buttonStep)}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var t=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=t:this._thumbClip.x=t,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(t,e){if(0!==this._trackLength&&u.default.check(this.lockId)){var n=((this._vertical?e:t)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var t=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?t+this._minValue:(t=Math.round(t/this._valueStep)*this._valueStep)+this._minValue},set:function(t){var e=(t-this._minValue)/(this._maxValue-this._minValue);e<0&&(e=0),e>1&&(e=1),e!==this._value&&(this._value=e,this._updateThumbFromValue())}}]),e}();e.default=c},function(t,e,n){t.exports=n(10)},function(t,e,n){"use strict";(function(e){var i=s(n(5)),r=s(n(12)),o=s(n(17)),a=s(n(1));function s(t){return t&&t.__esModule?t:{default:t}}var u={ComponentClip:i.default,UIComponents:r.default,Plugin:o.default,UIManager:a.default};t.exports=u,e.PhaserComps=u}).call(this,n(11))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=f(n(3)),r=f(n(13)),o=f(n(0)),a=f(n(6)),s=f(n(7)),u=f(n(8)),l=f(n(14)),c=f(n(15)),h=f(n(16));function f(t){return t&&t.__esModule?t:{default:t}}var p={UIComponentPrototype:o.default,UIButton:i.default,UIButtonSelect:a.default,UIButtonRadio:r.default,UIButtonDraggable:s.default,UIScrollBar:u.default,UIScrollPanel:l.default,UIProgressBar:c.default,UIContainer:h.default};e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(6),a=(i=o)&&i.__esModule?i:{default:i};var s=function(t){function e(t,n,i,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));return a._sibling=a,a._value=r,void 0!==o&&a.appendToRadio(o),a}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,a.default),r(e,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),r(e,[{key:"appendToRadio",value:function(t){this._sibling!==this&&this.removeFromSibling(),this._sibling=t._sibling,t._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var t=this._sibling;t!==this;)t.emit("event_select",this._value),t=t._sibling}},{key:"select",get:function(){return function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",this)},set:function(t){if(this._select!==t&&(function t(e,n,i,r){var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var a=Object.getPrototypeOf(e);null!==a&&t(a,n,i,r)}else if("value"in o&&o.writable)o.value=i;else{var s=o.set;void 0!==s&&s.call(r,i)}return i}(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"select",t,this),t)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(t){this._value=t}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var t=this._sibling;t!==this;){if(t.select)return t.value;t=t._sibling}return null},set:function(t){if(this.value!==t){for(var e=this._sibling;e!==this;)if(e.value===t)return void(e.select=!0)}else this.select=!0}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(0)),o=a(n(8));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(){function t(e,n,i,a,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._container=e,e.on(r.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=a,this._scrollBar=new o.default(e,i,s),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=s||!1}return i(t,[{key:"_onContainerUpdate",value:function(){var t=this._container._clip;if(t){this._panel=t.getChildClip(this._panelKey);var e=t.getChildClip(this._dimensionsKey);this._panel&&e&&(this._scrollBounds={x:e.x,y:e.y,len:this._vertical?this._panel.height-e.height:this._panel.width-e.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(t){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*t:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*t)}}]),t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(0),a=(i=o)&&i.__esModule?i:{default:i},s=function(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}(n(4));var u=/progress_(\d+)$/,l=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._value=0,i._steps=[],i}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,a.default),r(e,[{key:"onClipAppend",value:function(t){(function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._makeSteps(t),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var t=void 0,e=void 0,n=void 0,i=void 0,r=void 0,o=void 0,a=this._steps.length;for(t=0;t<a-1;t++){var s=this._steps[t],u=this._steps[t+1];if(s.stepValue===this._value){r=s.config;break}if(u.stepValue===this._value){r=u.config;break}if(this._value>s.stepValue&&this._value<u.stepValue){e=s.config,n=u.config,i=(this._value-s.stepValue)/(u.stepValue-s.stepValue);break}}if(!r)for(o in r={},e)if(n.hasOwnProperty(o)){var l=e[o],c=n[o];r[o]={x:l.x+(c.x-l.x)*i,y:l.y+(c.y-l.y)*i,scaleX:l.scaleX+(c.scaleX-l.scaleX)*i,scaleY:l.scaleY+(c.scaleY-l.scaleY)*i,angle:l.angle+(c.angle-l.angle)*i,alpha:l.alpha+(c.alpha-l.alpha)*i}}for(o in r)this._clip.applyChildParams(o,r[o])}}},{key:"_makeSteps",value:function(t){var n=this,i=t.getStateIds();this._steps=[],s.each(i,function(i){if(u.test(i)){var r={},o={stepValue:parseInt(u.exec(i)[1])/100,config:r},a=t.getStateConfig(i);for(var s in a)r[s]=e._makeFullConfig(a[s]);n._steps.push(o)}},this),s.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(t){this._value=t,this._applyValue()}}],[{key:"_makeFullConfig",value:function(t){return{x:t.hasOwnProperty("x")?t.x:0,y:t.hasOwnProperty("y")?t.y:0,scaleX:t.hasOwnProperty("scaleX")?t.scaleX:1,scaleY:t.hasOwnProperty("scaleY")?t.scaleY:1,angle:t.hasOwnProperty("angle")?t.angle:0,alpha:t.hasOwnProperty("alpha")?t.alpha:1}}}]),e}();e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},o=s(n(0)),a=(s(n(2)),s(n(4)));function s(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i._children=[],i._containerClip=null,i}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,o.default),i(e,[{key:"addChild",value:function(t){return-1!==this._children.indexOf(t)?t:(this._children.push(t),this._containerClip?this._addUIComponentToContainerClip(t):t._clip.groupVisible=!1,t)}},{key:"removeChild",value:function(t){var e=this._children.indexOf(t);return-1===e?t:(this._children.splice(e,1),this._containerClip&&this._removeUIComponentFromContainerClip(t),t)}},{key:"_addUIComponentToContainerClip",value:function(t){var e=this;a.default.each(t._clip.childrenList,function(t){e._containerClip.add(t)},this),t._clip.groupVisible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(t,e){var n=this;a.default.each(t._clip.childrenList,function(t){n._containerClip.remove(t,e)},this),t._clip.groupVisible=!1}},{key:"onClipAppend",value:function(t){var n=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipAppend",this).call(this,t),this._containerClip=t._container,this._containerClip&&a.default.each(this._children,function(t){n._addUIComponentToContainerClip(t)},this)}},{key:"onClipRemove",value:function(t){var n=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"onClipRemove",this).call(this,t),this._containerClip&&a.default.each(this._children,function(t){n._removeUIComponentFromContainerClip(t)},this)}},{key:"destroy",value:function(){var t=this;a.default.each(this._children,function(e){t._containerClip&&t._removeUIComponentFromContainerClip(e),e.destroy()},this),this._children.length=0,r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=a(n(2)),o=a(n(5));function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=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,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return t.registerGameObject("ui_component",n.addComponent,n.addComponent),n}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,r.default.Plugins.BasePlugin),i(e,[{key:"addComponent",value:function(t,e){return new o.default(this.scene,t,e)}}]),e}();e.default=s;var u={key:"UIComponents",plugin:s,start:!0};s.DefaultCfg=u}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("phaser"),require("underscore")):"function"==typeof define&&define.amd?define(["phaser","underscore"],t):"object"==typeof exports?exports.PhaserComps=t(require("phaser"),require("underscore")):e.PhaserComps=t(e.Phaser,e._)}(window,function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();n(2);var r,o=n(1);(r=o)&&r.__esModule;var a="event_state",u=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.lockId=null,i._parent=e,i._key=n,i._clip=null,i._texts={},n&&e&&e.on(a,i._onEventState,i),i._clipUpdate(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Phaser.Events.EventEmitter),i(t,null,[{key:"EVENT_STATE",get:function(){return a}}]),i(t,[{key:"appendClip",value:function(e){this._clip!==e&&(null!==this._clip&&this.removeClip(),this._clip=e,this._clip&&this.onClipAppend(this._clip),this._clipProcess())}},{key:"onClipAppend",value:function(e){}},{key:"removeClip",value:function(){this.onClipRemove(this._clip),this._clip=null}},{key:"onClipRemove",value:function(e){}},{key:"doState",value:function(){var e=this.getStateId();this._setupState(e)}},{key:"getText",value:function(e){return this._texts[e]}},{key:"setText",value:function(e,t){if(this._texts[e]!==t&&(this._texts[e]=t,this._clip)){var n=this._clip.getChildText(e);n&&(n.text=t)}}},{key:"getStateId",value:function(){return"default"}},{key:"destroy",value:function(){this._parent&&this._parent.removeListener(a,this._onEventState),this._clip&&this._clip.destroy()}},{key:"_clipUpdate",value:function(){if(this._key)if(this._parent._clip){var e=this._parent._clip.getChildClip(this._key);this.appendClip(e)}else this.appendClip(null);else;}},{key:"_clipProcess",value:function(){this._clip&&(this.doState(),this.onClipProcess())}},{key:"onClipProcess",value:function(){}},{key:"_setupState",value:function(e){if(this._clip)for(var t in this._clip.setState(e),this._texts){var n=this._clip.getChildText(t);n&&(n.text=this._texts[t])}this.emit(a)}},{key:"_onEventState",value:function(){this._clipUpdate()}}]),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=!1,o=[],a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"lock",value:function(e){this.unlock(),"string"==typeof e?o.push(e):e.forEach(function(e){return o.push(e)}),r=!0}},{key:"unlock",value:function(){o.length=0,r=!1}},{key:"check",value:function(e){return!r||-1!==o.indexOf(e)}}]),e}();t.default=a},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=a(n(0)),o=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r._enable=!0,r._isPressed=!1,r._isOver=!1,i&&(r.label=i),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default),i(t,null,[{key:"EVENT_CLICK",get:function(){return"event_click"}}]),i(t,[{key:"onClipAppend",value:function(e){this._updateInteractive()}},{key:"onClipRemove",value:function(e){var t=e.getChildClip("HIT_ZONE");t&&this._removeInteractive(t)}},{key:"_setupInteractive",value:function(e){e.setInteractive({useHandCursor:!0}),e.on("pointerdown",this._onPointerDown,this),e.on("pointerup",this._onPointerUp,this),e.on("pointerover",this._onPointerOver,this),e.on("pointerout",this._onPointerOut,this)}},{key:"_removeInteractive",value:function(e){e.disableInteractive(),e.removeListener("pointerdown",this._onPointerDown,this),e.removeListener("pointerup",this._onPointerUp,this),e.removeListener("pointerover",this._onPointerOver,this),e.removeListener("pointerout",this._onPointerOut,this)}},{key:"_updateInteractive",value:function(){if(this._clip){var e=this._clip.getChildClip("HIT_ZONE");e&&(this.enable?this._setupInteractive(e):this._removeInteractive(e))}}},{key:"getStateId",value:function(){return this.enable?this._isPressed?this.STATE_DOWN:this._isOver?this.STATE_OVER:this.STATE_UP:this.STATE_DISABLE}},{key:"_onClick",value:function(){this.emit("event_click")}},{key:"_onPointerOut",value:function(){this._isOver=!1,this._isPressed=!1,this.doState()}},{key:"_onPointerOver",value:function(){this._isOver=!0,this.doState()}},{key:"_onPointerDown",value:function(){this._isPressed=!0,this.doState()}},{key:"_onPointerUp",value:function(){var e=this._isPressed&&this._isOver;this._isPressed=!1,this.doState(),e&&o.default.check(this.lockId)&&this._onClick()}},{key:"destroy",value:function(){if(this._clip){var e=this._clip.getChildClip("HIT_ZONE");e&&this._removeInteractive(e)}(function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"label",get:function(){return this.getText("label")},set:function(e){this.setText("label",e)}},{key:"enable",get:function(){return this._enable},set:function(e){this._enable!==e&&(this._enable=e,this._updateInteractive(),this.doState())}},{key:"STATE_UP",get:function(){return"up"}},{key:"STATE_DOWN",get:function(){return"down"}},{key:"STATE_OVER",get:function(){return"over"}},{key:"STATE_DISABLE",get:function(){return"disable"}}]),t}();t.default=u},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=a(n(2)),o=a(n(4));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(e){function t(e,n,i){u(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,0,0));return r.childComponentClips=[],r._config=n,r._key=n.key,r._textures=i,r.imageFramesMap={},r._stateManager=new c(r,n),r._childrenById={},r._createImagesMap(i),r._parseConfig(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.default.GameObjects.Container),i(t,[{key:"getStateConfig",value:function(e){return this._stateManager.getStateConfigById(e)}},{key:"getStateIds",value:function(){return this._stateManager.stateIds}},{key:"setState",value:function(e,t){this._stateManager.setState(e,t)}},{key:"applyChildParams",value:function(e,n){this._childrenById.hasOwnProperty(e)&&t._setupCommonParams(this._childrenById[e],n)}},{key:"getChildClip",value:function(e){return this._stateManager.getActiveComponentByKey(e)}},{key:"getChildText",value:function(e){return this._stateManager.getActiveComponentByKey(e)}},{key:"destroy",value:function(){o.default.each(this.childComponentClips,function(e){e.destroy()},this)}},{key:"_createImagesMap",value:function(e){var t=this;o.default.each(e,function(e){var n=t.scene.textures.get(e);if(n){var i=n.getFrameNames();o.default.each(i,function(n){t.imageFramesMap[n]=e},t)}},this)}},{key:"_parseConfig",value:function(){var e=this;this._config.hasOwnProperty("children")&&o.default.each(this._config.children,function(t){e._createChildFromConfig(t)},this)}},{key:"_createChildFromConfig",value:function(e){var n=this,i=null,r=e.childId,a=e.key,u=!0;if("image"===e.type)i=this._createImageFromConfig(e);else if("text"===e.type)i=this._createTextFromConfig(e);else if("tileSprite"===e.type)i=this._createTileSpriteFromConfig(e);else if("component"===e.type)i=new t(this.scene,e,this._textures),t._setupCommonParams(i,e);else if("zone"===e.type)i=this._createHitZoneFromConfig(e);else if("polygon"===e.type&&(i=this._createPolygonFromConfig(e),e.hasOwnProperty("masking"))){var s=i.createGeometryMask();o.default.each(e.masking,function(e){n._childrenById[e].setMask(s)},this),u=!1}null!==i&&(this._childrenById[r]=i,this.childComponentClips.push(i),u&&this.add(i),this._stateManager.addComponent(i,r,a))}},{key:"_createPolygonFromConfig",value:function(e){var n=this.scene.make.graphics();n.fillStyle(e.color,e.hasOwnProperty("alpha")?e.alpha:1),n.beginPath();for(var i=e.vertices,r=i.length,o=0;o<r;o+=2)n.lineTo(i[o],i[o+1]);return n.closePath(),n.fillPath(),t._setupCommonParams(n,e),e.hasOwnProperty("masking")||this.scene.add.existing(n),n}},{key:"_createTileSpriteFromConfig",value:function(e){var n=this.scene.add.tileSprite(0,0,e.width,e.height,this.imageFramesMap[e.image],e.image);return n.setOrigin(.5,.5),t._setupCommonParams(n,e),n}},{key:"_createImageFromConfig",value:function(e){var n=this.scene.add.image(0,0,this.imageFramesMap[e.image],e.image);return n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createTextFromConfig",value:function(e){var n=this.scene.add.text(0,0,e.text,e.textStyle);return"center"===e.textStyle.align?n.setOrigin(.5,0):"right"===e.textStyle.align?n.setOrigin(1,0):n.setOrigin(0),t._setupCommonParams(n,e),n}},{key:"_createHitZoneFromConfig",value:function(e){return this.scene.add.zone(e.x||0,e.y||0,e.width,e.height).setOrigin(0)}}],[{key:"_setupCommonParams",value:function(e,t){var n=t.x||0,i=t.y||0,r=t.scaleX||1,o=t.scaleY||1,a=t.angle||0,u=t.hasOwnProperty("alpha")?t.alpha:1;e.x=n,e.y=i,e.scaleX=r,e.scaleY=o,e.angle=a,e.alpha=u}}]),t}();t.default=s;var l=function e(t){u(this,e),this.config=t,this.componentIds=[],this.componentIds=Object.keys(t)},c=function(){function e(t,n){u(this,e),this._clip=t,this._dynamicChildrenIds=[],this._states={},this.stateIds=[],this._components={},this._currentState=null,this._currentStateId=null,this._componentKeys={},this._residentComponentsByKey={};var i=[];for(var r in n.states){this.stateIds.push(r);var a=new l(n.states[r]);this._states[r]=a,i.push(a.componentIds)}this._dynamicChildrenIds=o.default.uniq(o.default.flatten(i))}return i(e,[{key:"getStateConfigById",value:function(e){return this._states.hasOwnProperty(e)?this._states[e].config:null}},{key:"addComponent",value:function(e,t,n){-1===o.default.indexOf(this._dynamicChildrenIds,t)?void 0!==n&&(this._residentComponentsByKey[n]=e):(this._components[t]=e,void 0!==n&&(this._componentKeys[t]=n))}},{key:"setState",value:function(e,t){(this._currentStateId!==e||t)&&this._states.hasOwnProperty(e)&&(this._currentStateId=e,this._currentState=this._states[e],this.setupState())}},{key:"getActiveComponentByKey",value:function(e){if(this._residentComponentsByKey.hasOwnProperty(e))return this._residentComponentsByKey[e];if(null===this._currentState)return null;for(var t in this._currentState.componentIds){var n=this._currentState.componentIds[t];if(this._componentKeys[n]===e)return this._components[n]}return null}},{key:"setupState",value:function(){var e=this,t=this._currentState.componentIds,n=o.default.difference(this._dynamicChildrenIds,t);o.default.each(n,function(t){e._components[t].visible=!1},this),o.default.each(t,function(t){var n=e._components[t];n.visible=!0,s._setupCommonParams(n,e._currentState.config[t])},this)}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},a=n(3),u=(i=a)&&i.__esModule?i:{default:i};var s=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i));return r._select=!1,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u.default),r(t,[{key:"getStateId",value:function(){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"getStateId",this).call(this)+(this._select?"_select":"")}},{key:"_onClick",value:function(){this._select=!this._select,this.doState(),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_onClick",this).call(this)}},{key:"select",get:function(){return this._select},set:function(e){this._select!==e&&(this._select=e,this.doState())}}]),t}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=u(n(3)),a=u(n(1));function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i));return r._dragBounds={minX:0,maxX:0,minY:0,maxY:0},r._startDragX=0,r._startDragY=0,r._dragZone=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,null,[{key:"EVENT_DRAG",get:function(){return"event_drag"}}]),r(t,[{key:"setDragBounds",value:function(e,t,n,i){this._dragBounds.minX=e,this._dragBounds.maxX=n,this._dragBounds.minY=t,this._dragBounds.maxY=i}},{key:"_onDragStart",value:function(e,t){this._dragZone&&this._dragZone===t&&this._clip&&(this._startDragX=this._clip.x-t.input.dragStartX,this._startDragY=this._clip.y-t.input.dragStartY)}},{key:"_onDrag",value:function(e,t,n,i){if(a.default.check(this.lockId)&&this._dragZone&&this._dragZone===t&&!this.clip){var r=this._startDragX+n,o=this._startDragY+i;r<this._dragBounds.minX?r=this._dragBounds.minX:r>this._dragBounds.maxX&&(r=this._dragBounds.maxX),o<this._dragBounds.minY?o=this._dragBounds.minY:o>this._dragBounds.maxY&&(o=this._dragBounds.maxY),this.emit("event_drag",r,o)}}},{key:"_setupInteractive",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_setupInteractive",this).call(this,e),this._dragZone=e,e.scene.input.setDraggable(e,!0),e.scene.input.on("dragstart",this._onDragStart,this),e.scene.input.on("drag",this._onDrag,this)}},{key:"_removeInteractive",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_removeInteractive",this).call(this,e),this._dragZone=null,e.scene.input.setDraggable(e,!1),e.scene.input.removeListener("dragstart",this._onDragStart),e.scene.input.removeListener("drag",this._onDrag)}}]),t}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=l(n(0)),a=l(n(3)),u=l(n(7)),s=l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r._vertical=i||!1,r._value=0,r._minValue=0,r._maxValue=1,r._valueStep=0,r._buttonStep=.1,r.btnPrev=new a.default(r,"btn_up"),r.btnPrev.on(a.default.EVENT_CLICK,r.onPrevClick,r),r.btnNext=new a.default(r,"btn_down"),r.btnNext.on(a.default.EVENT_CLICK,r.onNextClick,r),r.thumb=new u.default(r,"thumb"),r.thumb.on(u.default.EVENT_DRAG,r._onThumbDrag,r),r._trackStart=0,r._trackLength=100,r._thumbClip=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,null,[{key:"EVENT_CHANGE",get:function(){return"event_change"}}]),r(t,[{key:"setValueBounds",value:function(e,t,n){this._minValue=e,this._maxValue=t,void 0!==n?(this._valueStep=n,this._buttonStep<n&&(this._buttonStep=n)):this._valueStep=0}},{key:"setButtonStep",value:function(e){this._buttonStep=e}},{key:"onClipAppend",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onClipAppend",this).call(this,e),this._updateClips()}},{key:"_updateClips",value:function(){if(this._clip){this._thumbClip=this.thumb._clip;var e=this._clip.getChildClip("DIMENSIONS");e&&(this._trackStart=this._vertical?e.y:e.x,this._trackLength=this._vertical?e.height:e.width,this._thumbClip&&this.thumb.setDragBounds(this._vertical?this._thumbClip.x:e.x,this._vertical?e.y:this._thumbClip.y,this._vertical?this._thumbClip.x:e.x+e.width,this._vertical?e.y+e.height:this._thumbClip.y));var t=this._clip.getChildClip("HIT_ZONE");t&&t.on("pointerdown",this._onZoneDown,this),this._updateThumbFromValue()}}},{key:"onClipProcess",value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onClipProcess",this).call(this),this.thumb&&this._updateClips()}},{key:"onPrevClick",value:function(){s.default.check(this.lockId)&&(this.value-=this._buttonStep)}},{key:"onNextClick",value:function(){s.default.check(this.lockId)&&(this.value+=this._buttonStep)}},{key:"_updateThumbFromValue",value:function(){if(this._thumbClip){var e=Math.round(this._trackStart+this._trackLength*this._value);this._vertical?this._thumbClip.y=e:this._thumbClip.x=e,this.emit("event_change",this.value)}}},{key:"_onThumbDrag",value:function(e,t){if(0!==this._trackLength&&s.default.check(this.lockId)){var n=((this._vertical?t:e)-this._trackStart)/this._trackLength*(this._maxValue-this._minValue);0!==this._valueStep&&(n=Math.round(n/this._valueStep)*this._valueStep),this.value=n+this._minValue}}},{key:"_onZoneDown",value:function(){}},{key:"value",get:function(){var e=this._value*(this._maxValue-this._minValue);return 0===this._valueStep?e+this._minValue:(e=Math.round(e/this._valueStep)*this._valueStep)+this._minValue},set:function(e){var t=(e-this._minValue)/(this._maxValue-this._minValue);t<0&&(t=0),t>1&&(t=1),t!==this._value&&(this._value=t,this._updateThumbFromValue())}}]),t}();t.default=c},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";(function(t){var i=u(n(5)),r=u(n(12)),o=u(n(17)),a=u(n(1));function u(e){return e&&e.__esModule?e:{default:e}}var s={ComponentClip:i.default,UIComponents:r.default,Plugin:o.default,UIManager:a.default};e.exports=s,t.PhaserComps=s}).call(this,n(11))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=f(n(3)),r=f(n(13)),o=f(n(0)),a=f(n(6)),u=f(n(7)),s=f(n(8)),l=f(n(14)),c=f(n(15)),p=f(n(16));function f(e){return e&&e.__esModule?e:{default:e}}var h={UIComponentPrototype:o.default,UIButton:i.default,UIButtonSelect:a.default,UIButtonRadio:r.default,UIButtonDraggable:u.default,UIScrollBar:s.default,UIScrollPanel:l.default,UIProgressBar:c.default,UIContainer:p.default};t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(6),a=(i=o)&&i.__esModule?i:{default:i};var u=function(e){function t(e,n,i,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i));return a._sibling=a,a._value=r,void 0!==o&&a.appendToRadio(o),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),r(t,null,[{key:"EVENT_SELECT",get:function(){return"event_select"}}]),r(t,[{key:"appendToRadio",value:function(e){this._sibling!==this&&this.removeFromSibling(),this._sibling=e._sibling,e._sibling=this}},{key:"removeFromSibling",value:function(){}},{key:"_onClick",value:function(){this.select=!0}},{key:"_broadcastSelect",value:function(){this.emit("event_select",this.value);for(var e=this._sibling;e!==this;)e.emit("event_select",this._value),e=e._sibling}},{key:"select",get:function(){return function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"select",this)},set:function(e){if(this._select!==e&&(function e(t,n,i,r){var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);null!==a&&e(a,n,i,r)}else if("value"in o&&o.writable)o.value=i;else{var u=o.set;void 0!==u&&u.call(r,i)}return i}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"select",e,this),e)){for(var n=this._sibling;n!==this;)n.select=!1,n=n._sibling;this._broadcastSelect()}}},{key:"value",get:function(){return this._value},set:function(e){this._value=e}},{key:"valueSelected",get:function(){if(this.select)return this.value;for(var e=this._sibling;e!==this;){if(e.select)return e.value;e=e._sibling}return null},set:function(e){if(this.value!==e){for(var t=this._sibling;t!==this;)if(t.value===e)return void(t.select=!0)}else this.select=!0}}]),t}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=a(n(0)),o=a(n(8));function a(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(t,n,i,a,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._container=t,t.on(r.default.EVENT_STATE,this._onContainerUpdate,this),this._panelKey=n,this._dimensionsKey=a,this._scrollBar=new o.default(t,i,u),this._scrollBar.on(o.default.EVENT_CHANGE,this._onScrollBar,this),this._vertical=u||!1}return i(e,[{key:"_onContainerUpdate",value:function(){var e=this._container._clip;if(e){this._panel=e.getChildClip(this._panelKey);var t=e.getChildClip(this._dimensionsKey);this._panel&&t&&(this._scrollBounds={x:t.x,y:t.y,len:this._vertical?this._panel.height-t.height:this._panel.width-t.width},this._onScrollBar(this._onScrollBar.value))}}},{key:"_onScrollBar",value:function(e){this._panel&&this._scrollBounds&&(this._vertical?this._panel.y=this._scrollBounds.y-this._scrollBounds.len*e:this._panel.x=this._scrollBounds.x-this._scrollBounds.len*e)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0),a=(i=o)&&i.__esModule?i:{default:i},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(4));var s=/progress_(\d+)$/,l=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return i._value=0,i._steps=[],i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),r(t,[{key:"onClipAppend",value:function(e){(function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onClipAppend",this).call(this,e),this._makeSteps(e),this._applyValue()}},{key:"_applyValue",value:function(){if(this._clip){var e=void 0,t=void 0,n=void 0,i=void 0,r=void 0,o=void 0,a=this._steps.length;for(e=0;e<a-1;e++){var u=this._steps[e],s=this._steps[e+1];if(u.stepValue===this._value){r=u.config;break}if(s.stepValue===this._value){r=s.config;break}if(this._value>u.stepValue&&this._value<s.stepValue){t=u.config,n=s.config,i=(this._value-u.stepValue)/(s.stepValue-u.stepValue);break}}if(!r)for(o in r={},t)if(n.hasOwnProperty(o)){var l=t[o],c=n[o];r[o]={x:l.x+(c.x-l.x)*i,y:l.y+(c.y-l.y)*i,scaleX:l.scaleX+(c.scaleX-l.scaleX)*i,scaleY:l.scaleY+(c.scaleY-l.scaleY)*i,angle:l.angle+(c.angle-l.angle)*i,alpha:l.alpha+(c.alpha-l.alpha)*i}}for(o in r)this._clip.applyChildParams(o,r[o])}}},{key:"_makeSteps",value:function(e){var n=this,i=e.getStateIds();this._steps=[],u.each(i,function(i){if(s.test(i)){var r={},o={stepValue:parseInt(s.exec(i)[1])/100,config:r},a=e.getStateConfig(i);for(var u in a)r[u]=t._makeFullConfig(a[u]);n._steps.push(o)}},this),u.sortBy(this._steps,"stepValue")}},{key:"value",get:function(){return this._value},set:function(e){this._value=e,this._applyValue()}}],[{key:"_makeFullConfig",value:function(e){return{x:e.hasOwnProperty("x")?e.x:0,y:e.hasOwnProperty("y")?e.y:0,scaleX:e.hasOwnProperty("scaleX")?e.scaleX:1,scaleY:e.hasOwnProperty("scaleY")?e.scaleY:1,angle:e.hasOwnProperty("angle")?e.angle:0,alpha:e.hasOwnProperty("alpha")?e.alpha:1}}}]),t}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},o=u(n(0));n(2);var a=u(n(4));function u(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return i._children=[],i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),i(t,[{key:"addChild",value:function(e){return-1!==this._children.indexOf(e)?e:(this._children.push(e),this._clip?(e._clip.visible=!0,this._addUIComponentToContainerClip(e)):e._clip.visible=!1,e)}},{key:"removeChild",value:function(e){var t=this._children.indexOf(e);return-1===t?e:(this._children.splice(t,1),this._clip&&this._removeUIComponentFromContainerClip(e),e)}},{key:"_addUIComponentToContainerClip",value:function(e){this._clip.add(e._clip),e._clip.visible=!0}},{key:"_removeUIComponentFromContainerClip",value:function(e,t){this._clip.remove(e._clip,t),e._clip.visible=!1}},{key:"onClipAppend",value:function(e){var n=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onClipAppend",this).call(this,e),e&&a.default.each(this._children,function(e){n._addUIComponentToContainerClip(e)},this)}},{key:"onClipRemove",value:function(e){var n=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onClipRemove",this).call(this,e),e&&a.default.each(this._children,function(e){n._removeUIComponentFromContainerClip(e)},this)}},{key:"destroy",value:function(){var e=this;a.default.each(this._children,function(t){e._clip&&e._removeUIComponentFromContainerClip(t),t.destroy()},this),this._children.length=0,r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();n(2);var r,o=n(5),a=(r=o)&&r.__esModule?r:{default:r};var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return e.registerGameObject("ui_component",n.addComponent,n.makeComponent),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Phaser.Plugins.BasePlugin),i(t,[{key:"addComponent",value:function(e,t){var n=new a.default(this.scene,e,t);return this.scene.add.existing(n),n}},{key:"makeComponent",value:function(e,t){return new a.default(this.scene,e,t)}}]),t}();t.default=u;var s={key:"UIComponents",plugin:u,start:!0};u.DefaultCfg=s}])});
{
"name": "phaser-ui-comps",
"version": "0.1.3",
"version": "1.0.0",
"description": "Phaser 3 UI Components Framework and JSFL builder for Adobe Animate",

@@ -46,3 +46,3 @@ "main": "src/phasercomps.js",

"dependencies": {
"phaser": "^3.16.2",
"phaser": "^3.17.0",
"underscore": "^1.9.1"

@@ -49,0 +49,0 @@ },

@@ -61,40 +61,9 @@ import Phaser from "phaser";

* @classdesc
* Component clip is a group of Phaser GameObjects and child ComponentClips.
* @extends Phaser.GameObjects.Container
* Component clip is Phaser Container instance.
* Builds itself with provided jsfl-generated config object.
*
* The root clip, built with provided config, keeps array of built components, images and other stuff inside.
* In some cases it behaves like a group, but it's not really.
* All child ComponentClips, created inside, are settled in Phaser Containers, but the root is not.
* That was done firstly for the masks to work property. So if you need some masks in your component,
* they should be only in the root, because containers don't support masking inside.
* But the root mask can mask any child containers. Currently only shape masks are supported,
* see docs for more info.
*
* Clip supports state switching. Best if controlled by
* [UIComponentPrototype]{@link PhaserComps.UIComponents.UIComponentPrototype} instance
*
* *Note! do not change `x`, `y`, `scaleX`, `scaleY`, `angle`, `alpha`, `visible` properties of clip instance.*
*
* *If you need to move, scale, rotate, change alpha and visibility of the clip group, use*
* *`groupX`, `groupY`, `groupScaleX`, `groupScaleY`, `groupAngle`, `groupAlpha`, `groupVisible` properties*
*
* @property {Number} [groupX=0] clip group position x
* @property {Number} [groupY=0] clip group position x
* @property {Number} [groupAlpha=1] clip group alpha
* @property {Number} [groupScaleX=1] clip group scaleX
* @property {Number} [groupScaleY=1] clip group scaleY
* @property {Number} [groupAngle=0] clip group angle in degrees.
* Note, that every group child will be rotated around its own origin
* @property {Boolean} [groupVisible=true] clip group visibility flag
*
*
* @property {Number} x **only for private usage**, if you want to move clip manually, use `groupX`
* @property {Number} y **only for private usage**, if you want to move clip manually, use `groupY`
* @property {Number} scaleX **only for private usage**, if you want to scale clip manually, use `groupScaleX`
* @property {Number} scaleY **only for private usage**, if you want to scale clip manually, use `groupScaleY`
* @property {Number} alpha **only for private usage**, if you want to change clip alpha manually, use `groupAlpha`.
* @property {Number} angle **only for private usage**, if you want to rotate clip manually, use `groupAngle`.
* @property {Boolean} visible **only for private usage**, if you want to switch clip visibility manually,
* use `groupVisible`
* @see PhaserComps.UIComponents.UIComponentPrototype

@@ -105,35 +74,8 @@ *

* @param {Array<String>} textures Array of texture names, where component should find its texture frames
* @param {Boolean} [isChildComponent = false] used internally to build child component clips recursively
*/
export default class ComponentClip {
constructor(scene, config, textures, isChildComponent) {
this.scene = scene;
export default class ComponentClip extends Phaser.GameObjects.Container {
constructor(scene, config, textures) {
super(scene, 0, 0);
this.childComponentClips = [];
this.childrenList = [];
this._groupConfig = {
x: 0,
y: 0,
scaleX: 1,
scaleY: 1,
angle: 0,
alpha: 1,
visible: true
};
this._x = 0;
this._y = 0;
this._scaleX = 1;
this._scaleY = 1;
this._angle = 0;
this._angle = 0;
this._alpha = 1;
this._visible = true;
this._isChildComponent = isChildComponent || false;
if (this._isChildComponent) {
this._container = scene.add.container(0, 0);
this.childrenList.push(this._container);
}
/**

@@ -175,165 +117,2 @@ * component config object

get groupX() {
return this._groupConfig.x;
}
set groupX(val) {
if (this._groupConfig.x === val) {
return;
}
let delta = val - this._groupConfig.x;
this._groupConfig.x = val;
this.x += delta;
}
get groupY() {
return this._groupConfig.y;
}
set groupY(val) {
if (this._groupConfig.y === val) {
return;
}
let delta = val - this._groupConfig.y;
this._groupConfig.y = val;
this.y += delta;
}
get groupScaleX() {
return this._groupConfig.scaleX;
}
set groupScaleX(val) {
if (this._groupConfig.scaleX === val) {
return;
}
let delta = val / this._groupConfig.scaleX;
this._groupConfig.scaleX = val;
this.scaleX *= delta;
}
get groupScaleY() {
return this._groupConfig.scaleY;
}
set groupScaleY(val) {
if (this._groupConfig.scaleY === val) {
return;
}
let delta = val / this._groupConfig.scaleY;
this._groupConfig.scaleY = val;
this.scaleY *= delta;
}
get groupAlpha() {
return this._groupConfig.alpha;
}
set groupAlpha(val) {
if (this._groupConfig.alpha === val) {
return;
}
let delta = val / this._groupConfig.alpha;
this._groupConfig.alpha = val;
this.alpha *= delta;
}
get groupVisible() {
return this._groupConfig.visible;
}
set groupVisible(val) {
if (this._groupConfig.visible === val) {
return;
}
this._groupConfig.visible = val;
this._stateManager.setupState();
}
get x() {
return this._x;
}
set x(val) {
let delta = val - this.x;
Phaser.Actions.IncX(this.childrenList, delta);
this._x = val;
}
get y() {
return this._y;
}
set y(val) {
let delta = val - this.y;
Phaser.Actions.IncY(this.childrenList, delta);
this._y = val;
}
get visible() {
return this._visible;
}
set visible(val) {
if (this._visible === val) {
return;
}
this._visible = val;
Phaser.Actions.SetVisible(this.childrenList, val);
}
get alpha() {
return this._alpha;
}
set alpha(val) {
if (this._alpha === val) {
return;
}
this._alpha = val;
Phaser.Actions.SetAlpha(this.childrenList, val);
}
get scaleX() {
return this._scaleX;
}
set scaleX(val) {
if (this._scaleX === val) {
return;
}
this._scaleX = val;
Phaser.Actions.SetScaleX(this.childrenList, val);
}
get scaleY() {
return this._scaleY;
}
set scaleY(val) {
if (this._scaleY === val) {
return;
}
this._scaleY = val;
Phaser.Actions.SetScaleY(this.childrenList, val);
}
get angle() {
return this._angle;
}
set angle(val) {
if (this._angle === val) {
return;
}
Phaser.Actions.PropertyValueSet(this.childrenList, "angle", val);
}
setMask(mask) {
_.each(this.childrenList, (child) => {
child.setMask(mask);
}, this);
}
/**

@@ -376,3 +155,3 @@ * @public

* @public
* @method PhaserComps.ComponentClip#applyChildParamsapplyChildParams
* @method PhaserComps.ComponentClip#applyChildParams
* @description

@@ -387,3 +166,3 @@ * Apply child params

}
ComponentClip._setupCommonParams(this._childrenById[childId], params, this._groupConfig);
ComponentClip._setupCommonParams(this._childrenById[childId], params);
}

@@ -420,3 +199,3 @@

destroy() {
_.each(this.childrenList, child => {
_.each(this.childComponentClips, child => {
child.destroy();

@@ -473,5 +252,5 @@ }, this);

let child = null;
let childView = null;
let childId = config.childId;
let childKey = config.key;
let addAsChild = true;
if (config.type === TYPE_IMAGE) {

@@ -484,5 +263,4 @@ child = this._createImageFromConfig(config);

} else if (config.type === TYPE_COMPONENT) {
child = new ComponentClip(this.scene, config, this._textures, true);
child = new ComponentClip(this.scene, config, this._textures);
ComponentClip._setupCommonParams(child, config);
childView = child._container;
} else if (config.type === TYPE_ZONE) {

@@ -492,2 +270,10 @@ child = this._createHitZoneFromConfig(config);

child = this._createPolygonFromConfig(config);
if (config.hasOwnProperty("masking")) {
let mask = child.createGeometryMask();
_.each(config.masking, (maskedChildId) => {
let maskedChild = this._childrenById[maskedChildId];
maskedChild.setMask(mask);
}, this);
addAsChild = false;
}
}

@@ -498,20 +284,8 @@ if (child === null) {

}
if (childView === null) {
childView = child;
}
//ComponentView._setupCommonParams(child, config);
this._childrenById[childId] = child;
if (config.hasOwnProperty("masking")) {
// TODO check if the shape
let mask = child.createGeometryMask();
_.each(config.masking, (maskedChildId) => {
let maskedChild = this._childrenById[maskedChildId];
maskedChild.setMask(mask);
}, this);
this.childComponentClips.push(child);
if (addAsChild) {
this.add(child);
}
if (this._isChildComponent) {
this._container.add(childView);
} else {
this.childrenList.push(child);
}
this._stateManager.addComponent(child, childId, childKey);

@@ -628,6 +402,5 @@ }

* @param {Object} config
* @param {Object} [groupConfig]
* @ignore
*/
static _setupCommonParams(component, config, groupConfig) {
static _setupCommonParams(component, config) {
let x = config.x || 0;

@@ -639,10 +412,2 @@ let y = config.y || 0;

let alpha = config.hasOwnProperty("alpha") ? config.alpha : 1;
if (groupConfig) {
x += groupConfig.x;
y += groupConfig.y;
scaleX *= groupConfig.scaleX;
scaleY *= groupConfig.scaleY;
angle += groupConfig.angle;
alpha *= groupConfig.alpha;
}
component.x = x;

@@ -854,6 +619,6 @@ component.y = y;

let component = this._components[id];
component.visible = this._clip._groupConfig.visible; // && true;
ComponentClip._setupCommonParams(component, this._currentState.config[id], this._clip._groupConfig);
component.visible = true;
ComponentClip._setupCommonParams(component, this._currentState.config[id]);
}, this);
}
}

@@ -1,2 +0,2 @@

import Phaser from "phaser";
import "phaser";
import UIManager from "../manager/UIManager";

@@ -3,0 +3,0 @@

import UIComponentPrototype from "./UIComponentPrototype";
import Phaser from 'phaser';
import 'phaser';
import _ from 'underscore';

@@ -31,9 +31,2 @@

this._children = [];
/**
* Current active Phaser container instance
* @type {Phaser.GameObjects.Container}
* @private
*/
this._containerClip = null;
}

@@ -56,6 +49,7 @@

// add to container instance, or hide
if (this._containerClip) {
if (this._clip) {
child._clip.visible = true;
this._addUIComponentToContainerClip(child);
} else {
child._clip.groupVisible = false;
child._clip.visible = false;
}

@@ -80,3 +74,3 @@ return child;

if (this._containerClip) {
if (this._clip) {
this._removeUIComponentFromContainerClip(child);

@@ -93,6 +87,4 @@ }

_addUIComponentToContainerClip(child) {
_.each(child._clip.childrenList, clipChild => {
this._containerClip.add(clipChild);
}, this);
child._clip.groupVisible = true;
this._clip.add(child._clip);
child._clip.visible = true;
}

@@ -107,6 +99,4 @@

_removeUIComponentFromContainerClip(child, destroyChild) {
_.each(child._clip.childrenList, clipChild => {
this._containerClip.remove(clipChild, destroyChild);
}, this);
child._clip.groupVisible = false;
this._clip.remove(child._clip, destroyChild);
child._clip.visible = false;
}

@@ -116,4 +106,3 @@

super.onClipAppend(clip);
this._containerClip = clip._container;
if (this._containerClip) {
if (clip) {
_.each(this._children, child => {

@@ -128,3 +117,3 @@ this._addUIComponentToContainerClip(child);

// hide and remove children from current container
if (this._containerClip) {
if (clip) {
_.each(this._children, child => {

@@ -139,3 +128,3 @@ this._removeUIComponentFromContainerClip(child);

_.each(this._children, child => {
if (this._containerClip) { // TODO check if needed
if (this._clip) { // TODO check if needed
this._removeUIComponentFromContainerClip(child);

@@ -142,0 +131,0 @@ }

@@ -1,2 +0,2 @@

import Phaser from "phaser";
import "phaser";
import ComponentClip from "../clip/ComponentClip";

@@ -44,6 +44,12 @@

super(mgr);
mgr.registerGameObject("ui_component", this.addComponent, this.addComponent);
mgr.registerGameObject("ui_component", this.addComponent, this.makeComponent);
}
addComponent(config, textures) {
let clip = new ComponentClip(this.scene, config, textures);
this.scene.add.existing(clip);
return clip;
}
makeComponent(config, textures) {
return new ComponentClip(this.scene, config, textures);

@@ -50,0 +56,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc